]> git.pld-linux.org Git - packages/aiccu.git/blob - 12_memset-sizeof.patch
- cleanup
[packages/aiccu.git] / 12_memset-sizeof.patch
1 From: "Barak A. Pearlmutter" <barak+git@cs.nuim.ie>
2 Date: Sat, 22 Feb 2014 15:49:24 +0000
3 Subject: memset sizeof
4 MIME-Version: 1.0
5 Content-Type: text/plain; charset="utf-8"
6 Content-Transfer-Encoding: 8bit
7
8 Teeny little bug.
9
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 */
13
14 Guess it isn't sensitive.  Lucky a pointer takes less space than a struct MD5Context!
15 ---
16  common/hash_md5.c | 2 +-
17  1 file changed, 1 insertion(+), 1 deletion(-)
18
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)
24  
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 */
29  }
30  
31  #ifndef ASM_MD5
This page took 0.042146 seconds and 3 git commands to generate.