]> Pileus Git - ~andy/fetchmail/commitdiff
Properly erase MD5Context in MD5Final.
authorMatthias Andree <matthias.andree@gmx.de>
Thu, 31 May 2012 06:47:20 +0000 (08:47 +0200)
committerMatthias Andree <matthias.andree@gmx.de>
Thu, 31 May 2012 06:47:20 +0000 (08:47 +0200)
Found by clang.

md5c.c

diff --git a/md5c.c b/md5c.c
index 5f9b410e4404f8c4303f83efa4cfbff038be95f6..ad228b8b5945b37bd30b74eeebe98ceafd85f0fb 100644 (file)
--- a/md5c.c
+++ b/md5c.c
@@ -140,7 +140,7 @@ void MD5Final(void *digest, struct MD5Context *ctx)
     MD5Transform(ctx->buf, (uint32_t *) ctx->in);
     byteReverse((unsigned char *) ctx->buf, 4);
     memmove(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 */