Skip to content

Commit 46d56e0

Browse files
authored
Merge pull request #62 from alangefe/crypt-null
Fix segfault when crypt() returns NULL
2 parents db2933f + 158d6fd commit 46d56e0

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

src/session_server_ssh.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -787,6 +787,11 @@ auth_password_compare_pwd(const char *pass_hash, const char *pass_clear)
787787
new_pass_hash = crypt(pass_clear, pass_hash);
788788
pthread_mutex_unlock(&crypt_lock);
789789
#endif
790+
791+
if (!new_pass_hash) {
792+
return 1;
793+
}
794+
790795
return strcmp(new_pass_hash, pass_hash);
791796
}
792797

0 commit comments

Comments
 (0)