Module Name:    src
Committed By:   joerg
Date:           Fri Jul  1 02:24:14 UTC 2011

Modified Files:
        src/external/bsd/bind/dist/lib/isc: hmacsha.c sha2.c

Log Message:
Fix memset usage. XXX audit the rest where hard coded sizes are used


To generate a diff of this commit:
cvs rdiff -u -r1.2 -r1.3 src/external/bsd/bind/dist/lib/isc/hmacsha.c \
    src/external/bsd/bind/dist/lib/isc/sha2.c

Please note that diffs are not public domain; they are subject to the
copyright notices on the relevant files.

Modified files:

Index: src/external/bsd/bind/dist/lib/isc/hmacsha.c
diff -u src/external/bsd/bind/dist/lib/isc/hmacsha.c:1.2 src/external/bsd/bind/dist/lib/isc/hmacsha.c:1.3
--- src/external/bsd/bind/dist/lib/isc/hmacsha.c:1.2	Wed Feb 16 03:47:11 2011
+++ src/external/bsd/bind/dist/lib/isc/hmacsha.c	Fri Jul  1 02:24:14 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: hmacsha.c,v 1.2 2011/02/16 03:47:11 christos Exp $	*/
+/*	$NetBSD: hmacsha.c,v 1.3 2011/07/01 02:24:14 joerg Exp $	*/
 
 /*
  * Copyright (C) 2005-2007, 2009  Internet Systems Consortium, Inc. ("ISC")
@@ -227,7 +227,7 @@
 isc_hmacsha1_invalidate(isc_hmacsha1_t *ctx) {
 	isc_sha1_invalidate(&ctx->sha1ctx);
 	memset(ctx->key, 0, sizeof(ctx->key));
-	memset(ctx, 0, sizeof(ctx));
+	memset(ctx, 0, sizeof(*ctx));
 }
 
 /*
@@ -295,7 +295,7 @@
 void
 isc_hmacsha224_invalidate(isc_hmacsha224_t *ctx) {
 	memset(ctx->key, 0, sizeof(ctx->key));
-	memset(ctx, 0, sizeof(ctx));
+	memset(ctx, 0, sizeof(*ctx));
 }
 
 /*
@@ -362,7 +362,7 @@
 void
 isc_hmacsha256_invalidate(isc_hmacsha256_t *ctx) {
 	memset(ctx->key, 0, sizeof(ctx->key));
-	memset(ctx, 0, sizeof(ctx));
+	memset(ctx, 0, sizeof(*ctx));
 }
 
 /*
@@ -429,7 +429,7 @@
 void
 isc_hmacsha384_invalidate(isc_hmacsha384_t *ctx) {
 	memset(ctx->key, 0, sizeof(ctx->key));
-	memset(ctx, 0, sizeof(ctx));
+	memset(ctx, 0, sizeof(*ctx));
 }
 
 /*
@@ -496,7 +496,7 @@
 void
 isc_hmacsha512_invalidate(isc_hmacsha512_t *ctx) {
 	memset(ctx->key, 0, sizeof(ctx->key));
-	memset(ctx, 0, sizeof(ctx));
+	memset(ctx, 0, sizeof(*ctx));
 }
 
 /*
Index: src/external/bsd/bind/dist/lib/isc/sha2.c
diff -u src/external/bsd/bind/dist/lib/isc/sha2.c:1.2 src/external/bsd/bind/dist/lib/isc/sha2.c:1.3
--- src/external/bsd/bind/dist/lib/isc/sha2.c:1.2	Wed Feb 16 03:47:11 2011
+++ src/external/bsd/bind/dist/lib/isc/sha2.c	Fri Jul  1 02:24:14 2011
@@ -1,4 +1,4 @@
-/*	$NetBSD: sha2.c,v 1.2 2011/02/16 03:47:11 christos Exp $	*/
+/*	$NetBSD: sha2.c,v 1.3 2011/07/01 02:24:14 joerg Exp $	*/
 
 /*
  * Copyright (C) 2005-2007, 2009  Internet Systems Consortium, Inc. ("ISC")
@@ -897,7 +897,7 @@
 	}
 
 	/* Clean up state data: */
-	memset(context, 0, sizeof(context));
+	memset(context, 0, sizeof(*context));
 	usedspace = 0;
 }
 
@@ -1210,7 +1210,7 @@
 	}
 
 	/* Zero out state data */
-	memset(context, 0, sizeof(context));
+	memset(context, 0, sizeof(*context));
 }
 
 
@@ -1263,7 +1263,7 @@
 	}
 
 	/* Zero out state data */
-	memset(context, 0, sizeof(context));
+	memset(context, 0, sizeof(*context));
 }
 #endif /* !ISC_PLATFORM_OPENSSLHASH */
 
@@ -1294,7 +1294,7 @@
 #ifdef ISC_PLATFORM_OPENSSLHASH
 		EVP_MD_CTX_cleanup(context);
 #else
-		memset(context, 0, sizeof(context));
+		memset(context, 0, sizeof(*context));
 #endif
 	}
 	memset(digest, 0, ISC_SHA224_DIGESTLENGTH);
@@ -1333,7 +1333,7 @@
 #ifdef ISC_PLATFORM_OPENSSLHASH
 		EVP_MD_CTX_cleanup(context);
 #else
-		memset(context, 0, sizeof(context));
+		memset(context, 0, sizeof(*context));
 #endif
 	}
 	memset(digest, 0, ISC_SHA256_DIGESTLENGTH);
@@ -1372,7 +1372,7 @@
 #ifdef ISC_PLATFORM_OPENSSLHASH
 		EVP_MD_CTX_cleanup(context);
 #else
-		memset(context, 0, sizeof(context));
+		memset(context, 0, sizeof(*context));
 #endif
 	}
 	memset(digest, 0, ISC_SHA512_DIGESTLENGTH);
@@ -1411,7 +1411,7 @@
 #ifdef ISC_PLATFORM_OPENSSLHASH
 		EVP_MD_CTX_cleanup(context);
 #else
-		memset(context, 0, sizeof(context));
+		memset(context, 0, sizeof(*context));
 #endif
 	}
 	memset(digest, 0, ISC_SHA384_DIGESTLENGTH);

Reply via email to