1
0
mirror of https://git.libssh.org/projects/libssh.git synced 2025-11-30 13:01:23 +03:00

Fix a 0 bytes malloc in server kbdint implementation

This commit is contained in:
milo
2011-04-14 13:28:48 +02:00
parent 934252d6ca
commit 23b28a573c

View File

@@ -860,6 +860,7 @@ int ssh_message_auth_interactive_request(ssh_message msg, const char *name,
}
msg->session->kbdint->nprompts = num_prompts;
if(num_prompts > 0) {
msg->session->kbdint->prompts = malloc(num_prompts * sizeof(char *));
if (msg->session->kbdint->prompts == NULL) {
msg->session->kbdint->nprompts = 0;
@@ -886,6 +887,10 @@ int ssh_message_auth_interactive_request(ssh_message msg, const char *name,
return SSH_PACKET_USED;
}
}
} else {
msg->session->kbdint->prompts = NULL;
msg->session->kbdint->echo = NULL;
}
return r;
error: