summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlan Coopersmith <alan.coopersmith@oracle.com>2020-11-17 11:02:35 -0800
committerAlan Coopersmith <alan.coopersmith@oracle.com>2020-11-17 11:02:35 -0800
commit8d08bb2d2251ad282d020c6a136238cb314bbe60 (patch)
tree57fa29adf8893dbddeaff54f14018c40b50fd4fa
parent2c906e138333daf9e0f2186aa310ff42667f8ca6 (diff)
rstartd.real: Avoid buffer overflow reading from config file
Fixes: 20978_58 from https://cyber-itl.org/2020/10/28/citl-7000-defects.html Signed-off-by: Alan Coopersmith <alan.coopersmith@oracle.com>
-rw-r--r--server.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/server.c b/server.c
index 64cbd1b..9de968c 100644
--- a/server.c
+++ b/server.c
@@ -205,6 +205,11 @@ get_a_line(FILE *f, int *pargc, char ***pargv)
case EOF:
return FALSE;
default:
+ if (p >= (buf + sizeof(buf) - 2)) {
+ printf("%s: Failure: line too long\n",
+ myname);
+ exit(255);
+ }
*p++ = c;
break;
}