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) auth_userpass(char *user, char *pass, int *errorcode)
{ {
const char *encr; const char *encr;
const char *epass;
struct passwd *spw; struct passwd *spw;
struct spwd *stp; struct spwd *stp;
@ -84,8 +85,12 @@ auth_userpass(char *user, char *pass, int *errorcode)
/* old system with only passwd */ /* old system with only passwd */
encr = spw->pw_passwd; encr = spw->pw_passwd;
} }
epass = crypt(pass, encr);
return (strcmp(encr, crypt(pass, encr)) == 0); if (epass == 0)
{
return 0;
}
return (strcmp(encr, epass) == 0);
} }
/******************************************************************************/ /******************************************************************************/

Loading…
Cancel
Save