summaryrefslogtreecommitdiff
path: root/usr.bin/ssh
diff options
context:
space:
mode:
authorMarkus Friedl <markus@cvs.openbsd.org>2003-09-18 07:54:49 +0000
committerMarkus Friedl <markus@cvs.openbsd.org>2003-09-18 07:54:49 +0000
commit89976f12c3644ef6b56fe14ae1976591daa492c5 (patch)
treeb0b07b566ff064c6f61109a5ed2873af51860fbc /usr.bin/ssh
parente673feb759802bfedce949d86dd47a9c2d1de483 (diff)
protect against double free; #660; zardoz at users.sf.net
Diffstat (limited to 'usr.bin/ssh')
-rw-r--r--usr.bin/ssh/buffer.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/usr.bin/ssh/buffer.c b/usr.bin/ssh/buffer.c
index aee293f8bd4..a80880bb923 100644
--- a/usr.bin/ssh/buffer.c
+++ b/usr.bin/ssh/buffer.c
@@ -12,7 +12,7 @@
*/
#include "includes.h"
-RCSID("$OpenBSD: buffer.c,v 1.18 2003/09/16 21:02:39 markus Exp $");
+RCSID("$OpenBSD: buffer.c,v 1.19 2003/09/18 07:54:48 markus Exp $");
#include "xmalloc.h"
#include "buffer.h"
@@ -39,6 +39,7 @@ buffer_free(Buffer *buffer)
{
if (buffer->alloc > 0) {
memset(buffer->buf, 0, buffer->alloc);
+ buffer->alloc = 0;
xfree(buffer->buf);
}
}