Source-Changes-HG archive

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

[src/netbsd-2-0]: src/sys/dev Pull up revision 1.4 (requested by dan in ticke...



details:   https://anonhg.NetBSD.org/src/rev/c5caaa4a3d70
branches:  netbsd-2-0
changeset: 564729:c5caaa4a3d70
user:      tron <tron%NetBSD.org@localhost>
date:      Sun Mar 20 12:02:49 2005 +0000

description:
Pull up revision 1.4 (requested by dan in ticket #1343):
clear freed memory

diffstat:

 sys/dev/cgd_crypto.c |  8 ++++++--
 1 files changed, 6 insertions(+), 2 deletions(-)

diffs (50 lines):

diff -r ddacc8ccb343 -r c5caaa4a3d70 sys/dev/cgd_crypto.c
--- a/sys/dev/cgd_crypto.c      Sun Mar 20 11:58:55 2005 +0000
+++ b/sys/dev/cgd_crypto.c      Sun Mar 20 12:02:49 2005 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cgd_crypto.c,v 1.3 2004/03/18 10:42:08 dan Exp $ */
+/* $NetBSD: cgd_crypto.c,v 1.3.2.1 2005/03/20 12:02:49 tron Exp $ */
 
 /*-
  * Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -44,7 +44,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cgd_crypto.c,v 1.3 2004/03/18 10:42:08 dan Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgd_crypto.c,v 1.3.2.1 2005/03/20 12:02:49 tron Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -202,6 +202,7 @@
 {
        struct aes_privdata *apd = (void *)data;
 
+       memset(apd, 0, sizeof(*apd));
        free(apd, M_DEVBUF);
 }
 
@@ -300,6 +301,7 @@
        error |= des_key_sched((des_cblock *)key + 1, cp->cp_key2);
        error |= des_key_sched((des_cblock *)key + 2, cp->cp_key3);
        if (error) {
+               memset(cp, 0, sizeof(*cp));
                free(cp, M_DEVBUF);
                return NULL;
        }
@@ -311,6 +313,7 @@
 {
        struct c3des_privdata *cp = (void *)data;
 
+       memset(cp, 0, sizeof(*cp));
        free(cp, M_DEVBUF);
 }
 
@@ -410,6 +413,7 @@
 {
        struct  bf_privdata *bp = (void *)data;
 
+       memset(bp, 0, sizeof(*bp));
        free(bp, M_DEVBUF);
 }
 



Home | Main Index | Thread Index | Old Index