From: Richard Kettlewell Date: Sat, 10 Dec 2011 16:13:18 +0000 (+0000) Subject: md5: correct size arg to memset(). X-Git-Tag: v0.1.18.1~2 X-Git-Url: http://www.chiark.greenend.org.uk/ucgi/~ianmdlvl/git?a=commitdiff_plain;h=0def9f18f5ebadaede7c388db2ebf51d38cd6296;p=secnet.git md5: correct size arg to memset(). On realistic targets the effect of the error was that the MD5 context wasn't fully cleared. Signed-off-by: Richard Kettlewell (cherry picked from commit dfa6ab137e7565bd1afc03b045fff4aa737a7c9e) --- diff --git a/md5.c b/md5.c index 71fb4f1..8c57e25 100644 --- 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