Fix bug in SSH

This commit is contained in:
Andrew Pamment 2018-05-31 09:56:01 +10:00
parent a37329ff21
commit 0b8cc472d4

View File

@ -614,6 +614,13 @@ int ssh_authenticate(ssh_session p_ssh_session) {
do { do {
message = ssh_message_get(p_ssh_session); message = ssh_message_get(p_ssh_session);
if (message == NULL) {
ssh_message_free(message);
gUser = NULL;
return 0;
}
switch(ssh_message_type(message)) { switch(ssh_message_type(message)) {
case SSH_REQUEST_AUTH: case SSH_REQUEST_AUTH:
switch(ssh_message_subtype(message)) { switch(ssh_message_subtype(message)) {
@ -647,6 +654,7 @@ int ssh_authenticate(ssh_session p_ssh_session) {
ssh_message_reply_default(message); ssh_message_reply_default(message);
break; break;
} }
ssh_message_free(message); ssh_message_free(message);
} while(1); } while(1);
} }