]> 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:54 +0000 (08:47 +0200)
Found by clang.

md5c.c

diff --git a/md5c.c b/md5c.c
index fd05ae2a8f7fc422b707cee15bf15f55ab2122ff..49970bd003de8add9a8e04ef896b366aaef7735e 100644 (file)
--- a/md5c.c
+++ b/md5c.c
@@ -143,7 +143,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 */