commit 9fab2768090f0eb4428cd3aa855bd959d14728ac Author: Charlie Root Date: Fri Jul 4 16:46:24 2014 +0100 crypt(3_ checking potential NULL values diff --git a/contrib/opie/opieftpd.c b/contrib/opie/opieftpd.c index 143bf83..a5b588d 100644 --- a/contrib/opie/opieftpd.c +++ b/contrib/opie/opieftpd.c @@ -536,8 +536,10 @@ VOIDRET pass FUNCTION((passwd), char *passwd) if (!guest) { /* "ftp" is only account allowed no password */ #endif /* DOANONYMOUS */ i = opieverify(&opiestate, passwd); - if (legit && i && pwok) - i = strcmp(crypt(passwd, pw->pw_passwd), pw->pw_passwd); + if (legit && i && pwok) { + char *pp = crypt(passwd, pw->pw_passwd); + i = (pp ? strcmp(pp, pw->pw_passwd) : 0); + } if (!legit || i) { reply(530, "Login incorrect."); pw = NULL; diff --git a/contrib/opie/opielogin.c b/contrib/opie/opielogin.c index 1e5a8af..10427a5 100644 --- a/contrib/opie/opielogin.c +++ b/contrib/opie/opielogin.c @@ -1177,7 +1177,7 @@ completeness, but these are set within appropriate defines for portability. */ } else { if (authsok & 2) { pp = crypt(buf, thisuser.pw_passwd); - invalid = strcmp(pp, thisuser.pw_passwd); + invalid = (pp ? strcmp(pp, thisuser.pw_passwd) : TRUE); } else invalid = TRUE; } diff --git a/contrib/tcsh-6/tc.func.c b/contrib/tcsh-6/tc.func.c index b13fe04..b83b485 100644 --- a/contrib/tcsh-6/tc.func.c +++ b/contrib/tcsh-6/tc.func.c @@ -733,7 +733,7 @@ auto_lock(void) pp = xgetpass("Password:"); crpp = XCRYPT(pw, pp, srpp); - if ((strcmp(crpp, srpp) == 0) + if (crpp && (strcmp(crpp, srpp) == 0) #ifdef AFS || (ka_UserAuthenticateGeneral(KA_USERAUTH_VERSION, afsname, /* name */