mirror of
https://git.libssh.org/projects/libssh.git
synced 2025-05-17 19:21:11 +03:00
Fix free() on uninitialized data on some cases.
This commit is contained in:
parent
14d6b8856f
commit
47d11734e1
@ -256,6 +256,7 @@ SSH_PACKET_CALLBACK(ssh_packet_kexinit){
|
|||||||
enter_function();
|
enter_function();
|
||||||
(void)type;
|
(void)type;
|
||||||
(void)user;
|
(void)user;
|
||||||
|
memset(strings, 0, sizeof(strings));
|
||||||
if(session->session_state != SSH_SESSION_STATE_INITIAL_KEX){
|
if(session->session_state != SSH_SESSION_STATE_INITIAL_KEX){
|
||||||
ssh_set_error(session,SSH_FATAL,"SSH_KEXINIT received in wrong state");
|
ssh_set_error(session,SSH_FATAL,"SSH_KEXINIT received in wrong state");
|
||||||
goto error;
|
goto error;
|
||||||
@ -282,8 +283,6 @@ SSH_PACKET_CALLBACK(ssh_packet_kexinit){
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
memset(strings, 0, sizeof(char *) * 10);
|
|
||||||
|
|
||||||
for (i = 0; i < 10; i++) {
|
for (i = 0; i < 10; i++) {
|
||||||
str = buffer_get_ssh_string(packet);
|
str = buffer_get_ssh_string(packet);
|
||||||
if (str == NULL) {
|
if (str == NULL) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user