diff options
author | milo <milo.sshiva@gmail.com> | 2009-07-28 18:01:07 +0200 |
---|---|---|
committer | Andreas Schneider <mail@cynapses.org> | 2009-08-06 10:29:36 +0200 |
commit | 1b9676a0cc28e5dab6cea5ffe7c9fcd0fa10d9d8 (patch) | |
tree | 695104dd824160af03c02826f0e370ec524d0204 /libssh/server.c | |
parent | f4b3ef7604eac4a564159879ee2a5edb04a2c223 (diff) | |
download | libssh-1b9676a0cc28e5dab6cea5ffe7c9fcd0fa10d9d8.tar.gz libssh-1b9676a0cc28e5dab6cea5ffe7c9fcd0fa10d9d8.tar.xz libssh-1b9676a0cc28e5dab6cea5ffe7c9fcd0fa10d9d8.zip |
Fix possible memory corruption (#14)
Signed-off-by: Andreas Schneider <mail@cynapses.org>
Diffstat (limited to 'libssh/server.c')
-rw-r--r-- | libssh/server.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/libssh/server.c b/libssh/server.c index 5625229..1636123 100644 --- a/libssh/server.c +++ b/libssh/server.c @@ -423,7 +423,7 @@ static int dh_handshake_server(SSH_SESSION *session) { buffer_add_ssh_string(session->out_buffer, f) < 0 || buffer_add_ssh_string(session->out_buffer, sign) < 0) { ssh_set_error(session, SSH_FATAL, "Not enough space"); - buffer_free(session->out_buffer); + buffer_reinit(session->out_buffer); string_free(f); string_free(sign); return -1; @@ -436,7 +436,7 @@ static int dh_handshake_server(SSH_SESSION *session) { } if (buffer_add_u8(session->out_buffer, SSH2_MSG_NEWKEYS) < 0) { - buffer_free(session->out_buffer); + buffer_reinit(session->out_buffer); return -1; } |