diff options
author | Markus Friedl <markus@cvs.openbsd.org> | 2002-06-27 08:49:45 +0000 |
---|---|---|
committer | Markus Friedl <markus@cvs.openbsd.org> | 2002-06-27 08:49:45 +0000 |
commit | 8487ae4fa24719da5e777d00e283a80cae1b66ea (patch) | |
tree | 84dd42b88f0320399fc63c6bcadba409bdd5cbca /usr.bin/ssh | |
parent | 0445b09f3f25dfbc7352c577b23d08e08762b332 (diff) |
more checks for NULL pointers; from grendel@zeitbombe.org; ok deraadt@
Diffstat (limited to 'usr.bin/ssh')
-rw-r--r-- | usr.bin/ssh/dh.c | 4 | ||||
-rw-r--r-- | usr.bin/ssh/ssh-keyscan.c | 5 | ||||
-rw-r--r-- | usr.bin/ssh/sshconnect.c | 4 |
3 files changed, 7 insertions, 6 deletions
diff --git a/usr.bin/ssh/dh.c b/usr.bin/ssh/dh.c index 33187e02824..6ec37867a0b 100644 --- a/usr.bin/ssh/dh.c +++ b/usr.bin/ssh/dh.c @@ -23,7 +23,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: dh.c,v 1.21 2002/03/06 00:23:27 markus Exp $"); +RCSID("$OpenBSD: dh.c,v 1.22 2002/06/27 08:49:44 markus Exp $"); #include "xmalloc.h" @@ -50,7 +50,7 @@ parse_prime(int linenum, char *line, struct dhgroup *dhg) /* Ignore leading whitespace */ if (*arg == '\0') arg = strdelim(&cp); - if (!*arg || *arg == '#') + if (!arg || !*arg || *arg == '#') return 0; /* time */ diff --git a/usr.bin/ssh/ssh-keyscan.c b/usr.bin/ssh/ssh-keyscan.c index 947f704e547..0d4331a394b 100644 --- a/usr.bin/ssh/ssh-keyscan.c +++ b/usr.bin/ssh/ssh-keyscan.c @@ -7,7 +7,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: ssh-keyscan.c,v 1.36 2002/06/16 21:30:58 itojun Exp $"); +RCSID("$OpenBSD: ssh-keyscan.c,v 1.37 2002/06/27 08:49:44 markus Exp $"); #include <sys/queue.h> #include <errno.h> @@ -109,7 +109,8 @@ Linebuf_alloc(const char *filename, void (*errfun) (const char *,...)) if (!(lb = malloc(sizeof(*lb)))) { if (errfun) - (*errfun) ("linebuf (%s): malloc failed\n", lb->filename); + (*errfun) ("linebuf (%s): malloc failed\n", + filename ? filename : "(stdin)"); return (NULL); } if (filename) { diff --git a/usr.bin/ssh/sshconnect.c b/usr.bin/ssh/sshconnect.c index 335431fb98b..c9b0104237e 100644 --- a/usr.bin/ssh/sshconnect.c +++ b/usr.bin/ssh/sshconnect.c @@ -13,7 +13,7 @@ */ #include "includes.h" -RCSID("$OpenBSD: sshconnect.c,v 1.126 2002/06/23 03:30:17 deraadt Exp $"); +RCSID("$OpenBSD: sshconnect.c,v 1.127 2002/06/27 08:49:44 markus Exp $"); #include <openssl/bn.h> @@ -472,7 +472,7 @@ confirm(const char *prompt) (p[0] == '\0') || (p[0] == '\n') || strncasecmp(p, "no", 2) == 0) ret = 0; - if (strncasecmp(p, "yes", 3) == 0) + if (p && strncasecmp(p, "yes", 3) == 0) ret = 1; if (p) xfree(p); |