sesman: check for null from crypt()

ulab-next-nosound
Jay Sorg 10 years ago
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…
Cancel
Save