]> git.ipfire.org Git - thirdparty/openssh-portable.git/commitdiff
check for NULL return from shadow_pw()
authorDamien Miller <djm@mindrot.org>
Thu, 11 Oct 2018 00:03:15 +0000 (11:03 +1100)
committerDamien Miller <djm@mindrot.org>
Thu, 11 Oct 2018 00:03:54 +0000 (11:03 +1100)
probably unreachable on this platform; pointed out by
coolbugcheckers AT gmail.com

openbsd-compat/port-uw.c

index 9edb1b481151858fc9f65b61ca1a154dc95ea715..132213131e8f0cd69efffc67d61adc3372f3a4d4 100644 (file)
@@ -60,6 +60,9 @@ sys_auth_passwd(struct ssh *ssh, const char *password)
        /* Just use the supplied fake password if authctxt is invalid */
        char *pw_password = authctxt->valid ? shadow_pw(pw) : pw->pw_passwd;
 
+       if (pw_password == NULL)
+               return 0;
+
        /* Check for users with no password. */
        if (strcmp(pw_password, "") == 0 && strcmp(password, "") == 0)
                return (1);