aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAris Adamantiadis <aris@0xbadc0de.be>2010-12-19 12:33:31 +0100
committerAris Adamantiadis <aris@0xbadc0de.be>2010-12-19 12:33:31 +0100
commit47d11734e1303b1705f9fc23ee93776db2c47d65 (patch)
tree27d8d740bdfd2274eb3cbef95302390b72fa6272
parent14d6b8856f36d49666e421c51895bdd4c5cb9dcd (diff)
downloadlibssh-47d11734e1303b1705f9fc23ee93776db2c47d65.tar.gz
libssh-47d11734e1303b1705f9fc23ee93776db2c47d65.tar.xz
libssh-47d11734e1303b1705f9fc23ee93776db2c47d65.zip
Fix free() on uninitialized data on some cases.
-rw-r--r--src/kex.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/src/kex.c b/src/kex.c
index 2198652..3886934 100644
--- a/src/kex.c
+++ b/src/kex.c
@@ -256,6 +256,7 @@ SSH_PACKET_CALLBACK(ssh_packet_kexinit){
enter_function();
(void)type;
(void)user;
+ memset(strings, 0, sizeof(strings));
if(session->session_state != SSH_SESSION_STATE_INITIAL_KEX){
ssh_set_error(session,SSH_FATAL,"SSH_KEXINIT received in wrong state");
goto error;
@@ -282,8 +283,6 @@ SSH_PACKET_CALLBACK(ssh_packet_kexinit){
}
}
- memset(strings, 0, sizeof(char *) * 10);
-
for (i = 0; i < 10; i++) {
str = buffer_get_ssh_string(packet);
if (str == NULL) {