Source-Changes-HG archive

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

[src/trunk]: src/crypto/dist/ssh don't use freed memory. sync w/openbsd



details:   https://anonhg.NetBSD.org/src/rev/3744c1f1b097
branches:  trunk
changeset: 533461:3744c1f1b097
user:      itojun <itojun%NetBSD.org@localhost>
date:      Mon Jul 01 05:54:03 2002 +0000

description:
don't use freed memory.  sync w/openbsd

diffstat:

 crypto/dist/ssh/ssh-keysign.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (34 lines):

diff -r 9435cf100297 -r 3744c1f1b097 crypto/dist/ssh/ssh-keysign.c
--- a/crypto/dist/ssh/ssh-keysign.c     Mon Jul 01 03:10:01 2002 +0000
+++ b/crypto/dist/ssh/ssh-keysign.c     Mon Jul 01 05:54:03 2002 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ssh-keysign.c,v 1.1.1.1 2002/06/24 05:26:12 itojun Exp $       */
+/*     $NetBSD: ssh-keysign.c,v 1.2 2002/07/01 05:54:03 itojun Exp $   */
 /*
  * Copyright (c) 2002 Markus Friedl.  All rights reserved.
  *
@@ -23,7 +23,7 @@
  * THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
  */
 #include "includes.h"
-RCSID("$OpenBSD: ssh-keysign.c,v 1.4 2002/06/19 00:27:55 deraadt Exp $");
+RCSID("$OpenBSD: ssh-keysign.c,v 1.5 2002/06/26 22:27:32 markus Exp $");
 
 #include <openssl/evp.h>
 
@@ -183,7 +183,6 @@
        data = buffer_get_string(&b, &dlen);
        if (valid_request(pw, host, &key, data, dlen) < 0)
                fatal("not a valid request");
-       xfree(data);
        xfree(host);
 
        found = 0;
@@ -199,6 +198,7 @@
 
        if (key_sign(keys[i], &signature, &slen, data, dlen) != 0)
                fatal("key_sign failed");
+       xfree(data);
 
        /* send reply */
        buffer_clear(&b);



Home | Main Index | Thread Index | Old Index