From aff9b0f2b67eac784c99536fede9423da66f194a Mon Sep 17 00:00:00 2001 From: Tomas Mraz Date: Thu, 19 Jun 2014 13:51:20 +0200 Subject: pam_unix: Check for NULL return from Goodcrypt_md5(). modules/pam_unix/pam_unix_passwd.c (check_old_password): Check for NULL return from Goodcrypt_md5(). --- modules/pam_unix/pam_unix_passwd.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'modules/pam_unix/pam_unix_passwd.c') diff --git a/modules/pam_unix/pam_unix_passwd.c b/modules/pam_unix/pam_unix_passwd.c index 606071ea..2d330e51 100644 --- a/modules/pam_unix/pam_unix_passwd.c +++ b/modules/pam_unix/pam_unix_passwd.c @@ -301,7 +301,7 @@ static int check_old_password(const char *forwho, const char *newpass) s_pas = strtok_r(NULL, ":,", &sptr); while (s_pas != NULL) { char *md5pass = Goodcrypt_md5(newpass, s_pas); - if (!strcmp(md5pass, s_pas)) { + if (md5pass == NULL || !strcmp(md5pass, s_pas)) { _pam_delete(md5pass); retval = PAM_AUTHTOK_ERR; break; -- cgit v1.2.3