Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/netbsd-1-6]: src/crypto/dist/ssh Pull up revision 1.5 (requested by chri...



details:   https://anonhg.NetBSD.org/src/rev/3d7e128fc715
branches:  netbsd-1-6
changeset: 530729:3d7e128fc715
user:      tron <tron%NetBSD.org@localhost>
date:      Thu Sep 18 18:27:31 2003 +0000

description:
Pull up revision 1.5 (requested by christos in ticket #1477):
protect against double free; #660;  zardoz at users.sf.net
from openbsd

diffstat:

 crypto/dist/ssh/buffer.c |  9 +++++----
 1 files changed, 5 insertions(+), 4 deletions(-)

diffs (23 lines):

diff -r 48e1aaa4a0e9 -r 3d7e128fc715 crypto/dist/ssh/buffer.c
--- a/crypto/dist/ssh/buffer.c  Thu Sep 18 15:41:30 2003 +0000
+++ b/crypto/dist/ssh/buffer.c  Thu Sep 18 18:27:31 2003 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: buffer.c,v 1.1.1.6.2.3 2003/09/16 23:29:22 christos Exp $      */
+/*     $NetBSD: buffer.c,v 1.1.1.6.2.4 2003/09/18 18:27:31 tron Exp $  */
 /*
  * Author: Tatu Ylonen <ylo%cs.hut.fi@localhost>
  * Copyright (c) 1995 Tatu Ylonen <ylo%cs.hut.fi@localhost>, Espoo, Finland
@@ -39,9 +39,10 @@
 buffer_free(Buffer *buffer)
 {
        if (buffer->alloc > 0) {
-       memset(buffer->buf, 0, buffer->alloc);
-       xfree(buffer->buf);
-}
+               memset(buffer->buf, 0, buffer->alloc);
+               xfree(buffer->buf);
+               buffer->alloc = 0;
+       }
 }
 
 /*



Home | Main Index | Thread Index | Old Index