sesman: check for null from crypt()
This commit is contained in:
parent
9cb9a4bb57
commit
851c762ee7
@ -51,6 +51,7 @@ long DEFAULT_CC
|
||||
auth_userpass(char *user, char *pass, int *errorcode)
|
||||
{
|
||||
const char *encr;
|
||||
const char *epass;
|
||||
struct passwd *spw;
|
||||
struct spwd *stp;
|
||||
|
||||
@ -84,8 +85,12 @@ auth_userpass(char *user, char *pass, int *errorcode)
|
||||
/* old system with only passwd */
|
||||
encr = spw->pw_passwd;
|
||||
}
|
||||
|
||||
return (strcmp(encr, crypt(pass, encr)) == 0);
|
||||
epass = crypt(pass, encr);
|
||||
if (epass == 0)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return (strcmp(encr, epass) == 0);
|
||||
}
|
||||
|
||||
/******************************************************************************/
|
||||
|
Loading…
Reference in New Issue
Block a user