summaryrefslogtreecommitdiff
path: root/modules/pam_pwhistory
diff options
context:
space:
mode:
authorTomas Mraz <tmraz@fedoraproject.org>2013-02-08 15:04:26 +0100
committerTomas Mraz <tmraz@fedoraproject.org>2013-02-08 15:04:26 +0100
commit8dc056c1c8bc7acb66c4decc49add2c3a24e6310 (patch)
tree6bc6ebe09731ee52e67ecd702d2f4834221f15d9 /modules/pam_pwhistory
parente2a818773f96d12fc9f91bf2792a5a216c3b9aa4 (diff)
Add checks for crypt() returning NULL.
modules/pam_pwhistory/opasswd.c (compare_password): Add check for crypt() NULL return. modules/pam_unix/bigcrypt.c (bigcrypt): Likewise.
Diffstat (limited to 'modules/pam_pwhistory')
-rw-r--r--modules/pam_pwhistory/opasswd.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/modules/pam_pwhistory/opasswd.c b/modules/pam_pwhistory/opasswd.c
index 274fdb92..836d713e 100644
--- a/modules/pam_pwhistory/opasswd.c
+++ b/modules/pam_pwhistory/opasswd.c
@@ -108,7 +108,7 @@ compare_password(const char *newpass, const char *oldpass)
outval = crypt (newpass, oldpass);
#endif
- return strcmp(outval, oldpass) == 0;
+ return outval != NULL && strcmp(outval, oldpass) == 0;
}
/* Check, if the new password is already in the opasswd file. */