From f11fe301db707c84444c626beaa73b2adc1207ac Mon Sep 17 00:00:00 2001 From: mouring Date: Thu, 4 Jul 2002 00:03:56 +0000 Subject: [PATCH] - markus@cvs.openbsd.org 2002/06/27 08:49:44 [dh.c ssh-keyscan.c sshconnect.c] more checks for NULL pointers; from grendel@zeitbombe.org; ok deraadt@ --- ChangeLog | 4 ++++ dh.c | 4 ++-- ssh-keyscan.c | 5 +++-- sshconnect.c | 4 ++-- 4 files changed, 11 insertions(+), 6 deletions(-) diff --git a/ChangeLog b/ChangeLog index 0ddc849c..5205d664 100644 --- a/ChangeLog +++ b/ChangeLog @@ -2,6 +2,10 @@ - (bal) Updated contrib/cygwin/ patch by vinschen@redhat.com - (bal) minor correction to utimes() replacement. Patch by onoe@sm.sony.co.jp + - OpenBSD CVS Sync + - markus@cvs.openbsd.org 2002/06/27 08:49:44 + [dh.c ssh-keyscan.c sshconnect.c] + more checks for NULL pointers; from grendel@zeitbombe.org; ok deraadt@ 20020702 - (djm) Use PAM_MSG_MEMBER for PAM_TEXT_INFO messages, use xmalloc & diff --git a/dh.c b/dh.c index 33187e02..6ec37867 100644 --- a/dh.c +++ b/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/ssh-keyscan.c b/ssh-keyscan.c index 333a38e3..d9bbb91f 100644 --- a/ssh-keyscan.c +++ b/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 "openbsd-compat/fake-queue.h" @@ -116,7 +116,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/sshconnect.c b/sshconnect.c index b89321fb..32e57296 100644 --- a/sshconnect.c +++ b/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 @@ -476,7 +476,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); -- 2.45.2