summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
authorTomas Mraz <tmraz@fedoraproject.org>2014-06-19 13:51:20 +0200
committerTomas Mraz <tmraz@fedoraproject.org>2014-06-19 13:51:20 +0200
commitaff9b0f2b67eac784c99536fede9423da66f194a (patch)
tree7bd2cc5840ce155e3adcac2f7d04ee482020113c /modules
parent696d4cc68fb60461081e5f29c6ef3094feebac8d (diff)
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().
Diffstat (limited to 'modules')
-rw-r--r--modules/pam_unix/pam_unix_passwd.c2
1 files changed, 1 insertions, 1 deletions
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;