From: Sergio Ruiz Date: Wed, 10 May 2017 11:55:46 +0000 (+0200) Subject: Handle locked user accounts X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=efc92d1a63151818eaf921ae6ca7d076596884ee;p=pwauth Handle locked user accounts Prevent pwauth from crashing when logging into a locked account --- diff --git a/pwauth/auth_sun.c b/pwauth/auth_sun.c index fc3c3e8..461d1bb 100644 --- a/pwauth/auth_sun.c +++ b/pwauth/auth_sun.c @@ -84,7 +84,7 @@ int check_auth(char *login, char *passwd) #else cpass= crypt(passwd, spwd->sp_pwdp); #endif - if (strcmp(cpass, spwd->sp_pwdp)) return STATUS_INVALID; + if (!cpass || strcmp(cpass, spwd->sp_pwdp)) return STATUS_INVALID; #ifdef CHECK_LOGIN_EXPIRATION if (spwd->sp_expire >= 0 && spwd->sp_expire < today) return STATUS_EXPIRED;