chiark / gitweb /
md5: correct size arg to memset().
authorRichard Kettlewell <rjk@greenend.org.uk>
Sat, 10 Dec 2011 16:13:18 +0000 (16:13 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 10 Dec 2011 21:28:01 +0000 (21:28 +0000)
On realistic targets the effect of the error was that the MD5 context
wasn't fully cleared.

Signed-off-by: Richard Kettlewell <rjk@terraraq.org.uk>
md5.c

diff --git a/md5.c b/md5.c
index 2e0b9b8cc48df382ed3f4332f0bef4263a82ac24..343ad8fc893cdd29bbc208c74b7e044f7499d857 100644 (file)
--- a/md5.c
+++ b/md5.c
@@ -129,7 +129,7 @@ MD5Final(md5byte digest[16], struct MD5Context *ctx)
 
        byteSwap(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 */
 }
 
 #ifndef ASM_MD5