]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
MD5: Fix clearing of temporary stack memory to use correct length
authorJouni Malinen <j@w1.fi>
Fri, 15 Jul 2011 10:42:06 +0000 (13:42 +0300)
committerJouni Malinen <j@w1.fi>
Fri, 15 Jul 2011 10:42:06 +0000 (13:42 +0300)
sizeof of the structure instead of the pointer was supposed to be used
here. Fix this to clear the full structure at the end of MD5Final().

src/crypto/md5-internal.c

index f8692a9557aed0048fbbfc28494f1462b1f1e5b0..137ad9150f457ac9a4e0d577180468714fbfabdf 100644 (file)
@@ -188,7 +188,7 @@ void MD5Final(unsigned char digest[16], struct MD5Context *ctx)
     MD5Transform(ctx->buf, (u32 *) ctx->in);
     byteReverse((unsigned char *) ctx->buf, 4);
     os_memcpy(digest, ctx->buf, 16);
-    os_memset(ctx, 0, sizeof(ctx));    /* In case it's sensitive */
+    os_memset(ctx, 0, sizeof(*ctx));   /* In case it's sensitive */
 }
 
 /* The four core functions - F1 is optimized somewhat */