summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDamien Miller <djm@mindrot.org>2018-10-11 11:03:15 +1100
committerDamien Miller <djm@mindrot.org>2018-10-11 11:03:54 +1100
commitfe8e8f349a553ef4c567acd418aac769a82b7729 (patch)
tree03b5d37d4fff942f7e1a5052de36e597c8648e68
parentacc59cbe7a1fb169e1c3caba65a39bd74d6e030d (diff)
check for NULL return from shadow_pw()
probably unreachable on this platform; pointed out by coolbugcheckers AT gmail.com
-rw-r--r--openbsd-compat/port-uw.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/openbsd-compat/port-uw.c b/openbsd-compat/port-uw.c
index 9edb1b481..132213131 100644
--- a/openbsd-compat/port-uw.c
+++ b/openbsd-compat/port-uw.c
@@ -60,6 +60,9 @@ sys_auth_passwd(struct ssh *ssh, const char *password)
60 /* Just use the supplied fake password if authctxt is invalid */ 60 /* Just use the supplied fake password if authctxt is invalid */
61 char *pw_password = authctxt->valid ? shadow_pw(pw) : pw->pw_passwd; 61 char *pw_password = authctxt->valid ? shadow_pw(pw) : pw->pw_passwd;
62 62
63 if (pw_password == NULL)
64 return 0;
65
63 /* Check for users with no password. */ 66 /* Check for users with no password. */
64 if (strcmp(pw_password, "") == 0 && strcmp(password, "") == 0) 67 if (strcmp(pw_password, "") == 0 && strcmp(password, "") == 0)
65 return (1); 68 return (1);