Avoid segfault for locked accounts (invalid salt to crypt())

This commit is contained in:
Matt Johnston 2013-04-29 23:42:37 +08:00
parent 3ea9068e18
commit 57166b400c

View File

@ -66,6 +66,14 @@ void svr_auth_password() {
m_burn(password, passwordlen);
m_free(password);
if (testcrypt == NULL) {
/* crypt() with an invalid salt like "!!" */
dropbear_log(LOG_WARNING, "User account '%s' is locked",
ses.authstate.pw_name);
send_msg_userauth_failure(0, 1);
return;
}
/* check for empty password */
if (passwdcrypt[0] == '\0') {
dropbear_log(LOG_WARNING, "User '%s' has blank password, rejected",