diff options
author | kevlo <kevlo@FreeBSD.org> | 2012-02-22 06:27:20 +0000 |
---|---|---|
committer | kevlo <kevlo@FreeBSD.org> | 2012-02-22 06:27:20 +0000 |
commit | 1381e63d6caac1d5d064b60f6e2cb11bf0608e14 (patch) | |
tree | 456afe25d5d911e27dc003830e6ca01ed80dab54 /usr.sbin/ppp/auth.c | |
parent | 749a5f142f69ff02971e21c6dca8eab3f65d8de9 (diff) | |
download | FreeBSD-src-1381e63d6caac1d5d064b60f6e2cb11bf0608e14.zip FreeBSD-src-1381e63d6caac1d5d064b60f6e2cb11bf0608e14.tar.gz |
Handle NULL return from crypt(3). Mostly from DragonFly
Diffstat (limited to 'usr.sbin/ppp/auth.c')
-rw-r--r-- | usr.sbin/ppp/auth.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.sbin/ppp/auth.c b/usr.sbin/ppp/auth.c index 66a3de7..fbfc929 100644 --- a/usr.sbin/ppp/auth.c +++ b/usr.sbin/ppp/auth.c @@ -126,9 +126,11 @@ auth_CheckPasswd(const char *name, const char *data, const char *key) /* Then look up the real password database */ struct passwd *pw; int result; + char *cryptpw; + cryptpw = crypt(key, pw->pw_passwd); result = (pw = getpwnam(name)) && - !strcmp(crypt(key, pw->pw_passwd), pw->pw_passwd); + (cryptpw == NULL || !strcmp(cryptpw, pw->pw_passwd)); endpwent(); return result; #else /* !NOPAM */ |