Bug #3065 ยป 0002-Make-sure-strcmp-is-not-called-with-NULL-from-crypt.patch
usr.sbin/ppp/auth.c | ||
---|---|---|
static int
|
||
auth_CheckPasswd(const char *name, const char *data, const char *key)
|
||
{
|
||
struct passwd *pw;
|
||
int result = 0;
|
||
char *cryptpw;
|
||
if (!strcmp(data, "*")) {
|
||
/* Then look up the real password database */
|
||
struct passwd *pw;
|
||
int result;
|
||
pw = getpwnam(name);
|
||
if (pw) {
|
||
cryptpw = crypt(key, pw->pw_passwd);
|
||
result = cryptpw != NULL && !strcmp(cryptpw, pw->pw_passwd);
|
||
}
|
||
result = (pw = getpwnam(name)) &&
|
||
!strcmp(crypt(key, pw->pw_passwd), pw->pw_passwd);
|
||
endpwent();
|
||
return result;
|
||
}
|
||