From 7584cb1ac4daafbfb3dec592dd7ef48b81d20eea Mon Sep 17 00:00:00 2001 From: Damien Miller Date: Thu, 26 Apr 2012 09:51:26 +1000 Subject: - (djm) [auth-passwd.c] Handle crypt() returning NULL; from Paul Wouters via Niels --- auth-passwd.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'auth-passwd.c') diff --git a/auth-passwd.c b/auth-passwd.c index b1c6ce09..68bbd18d 100644 --- a/auth-passwd.c +++ b/auth-passwd.c @@ -209,6 +209,7 @@ sys_auth_passwd(Authctxt *authctxt, const char *password) * Authentication is accepted if the encrypted passwords * are identical. */ - return (strcmp(encrypted_password, pw_password) == 0); + return encrypted_password != NULL && + strcmp(encrypted_password, pw_password) == 0; } #endif -- cgit v1.2.1