From 3d269acefa5c558a800004c6137a4370089b179d Mon Sep 17 00:00:00 2001 From: Stefan Schmidt Date: Fri, 16 May 2014 14:32:51 +0200 Subject: [PATCH] ethumb: Memset whole contex in md5 implementation I don't know what they tried here but if we consider the content of ctx sensitive we should memset the whole thing. CID 222382 --- src/lib/ethumb/md5.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/lib/ethumb/md5.c b/src/lib/ethumb/md5.c index 9cfc8b5..d437166 100644 --- a/src/lib/ethumb/md5.c +++ b/src/lib/ethumb/md5.c @@ -147,7 +147,7 @@ void MD5Final(unsigned char digest[16], MD5_CTX *ctx) MD5Transform(ctx->buf, ctx->in.i); byteReverse((unsigned char *) ctx->buf, 4); memcpy(digest, ctx->buf, 16); - memset((char *) ctx, 0, sizeof(ctx)); /* In case it's sensitive */ + memset(ctx, 0, sizeof(MD5_CTX)); /* In case it's sensitive */ } /* The four core functions - F1 is optimized somewhat */ -- 2.7.4