From: djm Date: Sun, 26 Mar 2006 02:53:32 +0000 (+0000) Subject: - djm@cvs.openbsd.org 2006/03/19 02:24:05 X-Git-Tag: V_4_4_P1~322 X-Git-Url: http://andersk.mit.edu/gitweb/openssh.git/commitdiff_plain/88299971ecb7faaae5ebdba5ae5ed0813403c633 - djm@cvs.openbsd.org 2006/03/19 02:24:05 [dh.c readconf.c servconf.c] potential NULL pointer dereferences detected by Coverity via elad AT netbsd.org; ok deraadt@ --- diff --git a/ChangeLog b/ChangeLog index 07a3600b..47e33db0 100644 --- a/ChangeLog +++ b/ChangeLog @@ -26,6 +26,10 @@ [hostfile.c] FILE* leak detected by Coverity via elad AT netbsd.org; ok deraadt@ + - djm@cvs.openbsd.org 2006/03/19 02:24:05 + [dh.c readconf.c servconf.c] + potential NULL pointer dereferences detected by Coverity + via elad AT netbsd.org; ok deraadt@ 20060325 - OpenBSD CVS Sync diff --git a/dh.c b/dh.c index a30b704f..e8ce3d1a 100644 --- a/dh.c +++ b/dh.c @@ -45,7 +45,8 @@ parse_prime(int linenum, char *line, struct dhgroup *dhg) char *strsize, *gen, *prime; cp = line; - arg = strdelim(&cp); + if ((arg = strdelim(&cp)) == NULL) + return 0; /* Ignore leading whitespace */ if (*arg == '\0') arg = strdelim(&cp); diff --git a/readconf.c b/readconf.c index 1112d0d8..e2e10d9d 100644 --- a/readconf.c +++ b/readconf.c @@ -324,7 +324,8 @@ process_config_line(Options *options, const char *host, s = line; /* Get the keyword. (Each line is supposed to begin with a keyword). */ - keyword = strdelim(&s); + if ((keyword = strdelim(&s)) == NULL) + return 0; /* Ignore leading whitespace. */ if (*keyword == '\0') keyword = strdelim(&s); diff --git a/servconf.c b/servconf.c index 2ae93d4c..7923f5df 100644 --- a/servconf.c +++ b/servconf.c @@ -447,7 +447,8 @@ process_server_config_line(ServerOptions *options, char *line, u_int i; cp = line; - arg = strdelim(&cp); + if ((arg = strdelim(&cp)) != NULL) + return 0; /* Ignore leading whitespace */ if (*arg == '\0') arg = strdelim(&cp);