Source-Changes-HG archive
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]
[src/trunk]: src/sys/dev Fix incomplete conversion from stack buffers to heap...
details: https://anonhg.NetBSD.org/src/rev/77aa242091da
branches: trunk
changeset: 747327:77aa242091da
user: tron <tron%NetBSD.org@localhost>
date: Fri Sep 11 13:36:37 2009 +0000
description:
Fix incomplete conversion from stack buffers to heap buffers.
diffstat:
sys/dev/cgd.c | 14 +++++++-------
1 files changed, 7 insertions(+), 7 deletions(-)
diffs (56 lines):
diff -r 2703a4a657c4 -r 77aa242091da sys/dev/cgd.c
--- a/sys/dev/cgd.c Fri Sep 11 13:11:15 2009 +0000
+++ b/sys/dev/cgd.c Fri Sep 11 13:36:37 2009 +0000
@@ -1,4 +1,4 @@
-/* $NetBSD: cgd.c,v 1.59 2009/09/11 09:28:34 tron Exp $ */
+/* $NetBSD: cgd.c,v 1.60 2009/09/11 13:36:37 tron Exp $ */
/*-
* Copyright (c) 2002 The NetBSD Foundation, Inc.
@@ -30,7 +30,7 @@
*/
#include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.59 2009/09/11 09:28:34 tron Exp $");
+__KERNEL_RCSID(0, "$NetBSD: cgd.c,v 1.60 2009/09/11 13:36:37 tron Exp $");
#include <sys/types.h>
#include <sys/param.h>
@@ -792,7 +792,7 @@
DIAGCONDPANIC(sizeof(daddr_t) > blocksize,
("cgd_cipher: sizeof(daddr_t) > blocksize"));
- memset(zero_iv, 0x0, sizeof(zero_iv));
+ memset(zero_iv, 0x0, blocksize);
dstuio.uio_iov = dstiov;
dstuio.uio_iovcnt = 2;
@@ -811,13 +811,13 @@
dstiov[1].iov_base = dst;
srciov[1].iov_base = src;
- memset(blkno_buf, 0x0, sizeof(blkno_buf));
+ memset(blkno_buf, 0x0, blocksize);
blkno2blkno_buf(blkno_buf, blkno);
if (dir == CGD_CIPHER_DECRYPT) {
dstuio.uio_iovcnt = 1;
srcuio.uio_iovcnt = 1;
IFDEBUG(CGDB_CRYPTO, hexprint("step 0: blkno_buf",
- blkno_buf, sizeof(blkno_buf)));
+ blkno_buf, blocksize));
cipher(cs->sc_cdata.cf_priv, &dstuio, &srcuio,
zero_iv, CGD_CIPHER_ENCRYPT);
memcpy(blkno_buf, sink, blocksize);
@@ -826,10 +826,10 @@
}
IFDEBUG(CGDB_CRYPTO, hexprint("step 1: blkno_buf",
- blkno_buf, sizeof(blkno_buf)));
+ blkno_buf, blocksize));
cipher(cs->sc_cdata.cf_priv, &dstuio, &srcuio, zero_iv, dir);
IFDEBUG(CGDB_CRYPTO, hexprint("step 2: sink",
- sink, sizeof(sink)));
+ sink, blocksize));
dst += secsize;
src += secsize;
Home |
Main Index |
Thread Index |
Old Index