From d119301b5816b39b5ba722a2f8b301b37e8e34bd Mon Sep 17 00:00:00 2001 From: Michael Young Date: Wed, 13 Feb 2013 17:00:15 +0000 Subject: tools: Fix memset(&p,0,sizeof(p)) idiom in several places. gcc 4.8 identifies several places where code of the form memset(x, 0, sizeof(x)); is used incorrectly, meaning that less memory is set to zero than required. Signed-off-by: Michael Young Committed-by: Keir Fraser --- tools/blktap2/drivers/md5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'tools/blktap2') diff --git a/tools/blktap2/drivers/md5.c b/tools/blktap2/drivers/md5.c index 27a360eba1..e765832479 100644 --- a/tools/blktap2/drivers/md5.c +++ b/tools/blktap2/drivers/md5.c @@ -174,7 +174,7 @@ void MD5Final(unsigned char digest[16], struct MD5Context *ctx) MD5Transform(ctx->buf, (uint32_t *) ctx->in); byteReverse((unsigned char *) ctx->buf, 4); memcpy(digest, ctx->buf, 16); - memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */ + memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */ } /* The four core functions - F1 is optimized somewhat */ -- cgit v1.2.3