From: Timo Sirainen Date: Tue, 20 Jul 2004 12:44:29 +0000 (+0300) Subject: md5_final() didn't properly clear the whole MD5 context. Also changed to use X-Git-Tag: 1.1.alpha1~3769 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d06762f6d6db1b02f19593835c1db44dc0b91309;p=thirdparty%2Fdovecot%2Fcore.git md5_final() didn't properly clear the whole MD5 context. Also changed to use safe_memset(). Patch by Andrey Panin --HG-- branch : HEAD --- diff --git a/src/lib/md5.c b/src/lib/md5.c index e66929c734..55a756800d 100644 --- a/src/lib/md5.c +++ b/src/lib/md5.c @@ -16,6 +16,7 @@ */ #include "lib.h" +#include "safe-memset.h" #include "md5.h" /* @@ -267,7 +268,7 @@ void md5_final(struct md5_context *ctx, unsigned char result[16]) result[14] = ctx->d >> 16; result[15] = ctx->d >> 24; - memset(ctx, 0, sizeof(ctx)); + safe_memset(ctx, 0, sizeof(*ctx)); } void md5_get_digest(const void *data, size_t size, unsigned char result[16])