1 From: "Barak A. Pearlmutter" <barak+git@cs.nuim.ie>
2 Date: Sat, 22 Feb 2014 15:49:24 +0000
5 Content-Type: text/plain; charset="utf-8"
6 Content-Transfer-Encoding: 8bit
10 ../common/hash_md5.c: In function ‘MD5Final’:
11 ../common/hash_md5.c:134:23: warning: argument to ‘sizeof’ in ‘memset’ call is the same expression as the destination; did you mean to dereference it? [-Wsizeof-pointer-memaccess]
12 memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */
14 Guess it isn't sensitive. Lucky a pointer takes less space than a struct MD5Context!
16 common/hash_md5.c | 2 +-
17 1 file changed, 1 insertion(+), 1 deletion(-)
19 diff --git a/common/hash_md5.c b/common/hash_md5.c
20 index 160b849..ca4c1b9 100755
21 --- a/common/hash_md5.c
22 +++ b/common/hash_md5.c
23 @@ -131,7 +131,7 @@ MD5Final(md5byte digest[16], struct MD5Context *ctx)
25 byteSwap(ctx->buf, 4);
26 memcpy(digest, ctx->buf, 16);
27 - memset(ctx, 0, sizeof(ctx)); /* In case it's sensitive */
28 + memset(ctx, 0, sizeof(*ctx)); /* In case it's sensitive */