diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2005-05-16 15:30:52 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2005-05-16 15:30:52 +0000 |
commit | 1bd78b238ddf44abbd06d87174e3960ac2ccedc2 (patch) | |
tree | 3ee19dff0f88a5a58e0cfe4a0cf75bd485d62674 /usr.bin | |
parent | 18d0f28f3d222a391f075cc8a7a2e5bbbf96e3f1 (diff) |
check return value from strdelim() for NULL (AddressFamily); mpech
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/ssh/readconf.c | 5 | ||||
-rw-r--r-- | usr.bin/ssh/servconf.c | 5 |
2 files changed, 8 insertions, 2 deletions
diff --git a/usr.bin/ssh/readconf.c b/usr.bin/ssh/readconf.c index 414d69c3668..ab7b2baf884 100644 --- a/usr.bin/ssh/readconf.c +++ b/usr.bin/ssh/readconf.c @@ -12,7 +12,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: readconf.c,v 1.139 2005/03/10 22:01:05 deraadt Exp $"); +RCSID("$OpenBSD: readconf.c,v 1.140 2005/05/16 15:30:51 markus Exp $"); #include "ssh.h" #include "xmalloc.h" @@ -741,6 +741,9 @@ parse_int: case oAddressFamily: arg = strdelim(&s); + if (!arg || *arg == '\0') + fatal("%s line %d: missing address family.", + filename, linenum); intptr = &options->address_family; if (strcasecmp(arg, "inet") == 0) value = AF_INET; diff --git a/usr.bin/ssh/servconf.c b/usr.bin/ssh/servconf.c index 0e40efc4e48..1a8b8d10aba 100644 --- a/usr.bin/ssh/servconf.c +++ b/usr.bin/ssh/servconf.c @@ -10,7 +10,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: servconf.c,v 1.140 2005/03/10 22:01:05 deraadt Exp $"); +RCSID("$OpenBSD: servconf.c,v 1.141 2005/05/16 15:30:51 markus Exp $"); #include "ssh.h" #include "log.h" @@ -491,6 +491,9 @@ parse_time: case sAddressFamily: arg = strdelim(&cp); + if (!arg || *arg == '\0') + fatal("%s line %d: missing address family.", + filename, linenum); intptr = &options->address_family; if (options->listen_addrs != NULL) fatal("%s line %d: address family must be specified before " |