summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormarkus <markus@openbsd.org>2005-05-16 15:30:51 +0000
committermarkus <markus@openbsd.org>2005-05-16 15:30:51 +0000
commit86c7cf56512ec7c590f1f5ae5e0f44ffb9334bf9 (patch)
treeee6565d0d980fc47bc8248b49e6af0fe82af88f7
parentDo not call out mkdir -p, but reuse the code from mkdir(1). (diff)
downloadwireguard-openbsd-86c7cf56512ec7c590f1f5ae5e0f44ffb9334bf9.tar.xz
wireguard-openbsd-86c7cf56512ec7c590f1f5ae5e0f44ffb9334bf9.zip
check return value from strdelim() for NULL (AddressFamily); mpech
-rw-r--r--usr.bin/ssh/readconf.c5
-rw-r--r--usr.bin/ssh/servconf.c5
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 "