check for NULL return from shadow_pw()

probably unreachable on this platform; pointed out by
coolbugcheckers AT gmail.com
This commit is contained in:
Damien Miller 2018-10-11 11:03:15 +11:00
parent acc59cbe7a
commit fe8e8f349a
1 changed files with 3 additions and 0 deletions

View 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);