[Dovecot] [PATCH] fix MD5 code buglet

Andrey Panin pazke at donpac.ru
Tue Jul 20 15:08:17 EEST 2004


Hello,

md5_final() function contains minor buglet, it clears first
4 bytes of md5_context instead of whole structure. Patch
attached.

Best regards.

-- 
Andrey Panin		| Linux and UNIX system administrator
pazke at donpac.ru		| PGP key: wwwkeys.pgp.net
-------------- next part --------------
diff -urpNX /usr/share/dontdiff dovecot-1.0-test28.vanilla/src/lib/md5.c dovecot-1.0-test28/src/lib/md5.c
--- dovecot-1.0-test28.vanilla/src/lib/md5.c	2004-04-28 00:04:20.000000000 +0400
+++ dovecot-1.0-test28/src/lib/md5.c	2004-07-20 15:44:56.000000000 +0400
@@ -267,7 +267,7 @@ void md5_final(struct md5_context *ctx, 
 	result[14] = ctx->d >> 16;
 	result[15] = ctx->d >> 24;
 
-	memset(ctx, 0, sizeof(ctx));
+	memset(ctx, 0, sizeof(*ctx));
 }
 
 void md5_get_digest(const void *data, size_t size, unsigned char result[16])
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://dovecot.org/pipermail/dovecot/attachments/20040720/edfce3db/attachment-0001.bin>


More information about the dovecot mailing list