[dovecot-cvs] dovecot/src/lib md5.c,1.7,1.8

cras at dovecot.org cras at dovecot.org
Tue Jul 20 15:44:31 EEST 2004


Update of /home/cvs/dovecot/src/lib
In directory talvi:/tmp/cvs-serv16107

Modified Files:
	md5.c 
Log Message:
md5_final() didn't properly clear the whole MD5 context. Also changed to use
safe_memset(). Patch by Andrey Panin



Index: md5.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib/md5.c,v
retrieving revision 1.7
retrieving revision 1.8
diff -u -d -r1.7 -r1.8
--- md5.c	5 Jan 2003 13:09:51 -0000	1.7
+++ md5.c	20 Jul 2004 12:44:29 -0000	1.8
@@ -16,6 +16,7 @@
  */
 
 #include "lib.h"
+#include "safe-memset.h"
 #include "md5.h"
 
 /*
@@ -267,7 +268,7 @@
 	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])



More information about the dovecot-cvs mailing list