Browse Source

In MDStringArray() don't call MD5Update() on empty elements of array. This
doesn't change checksum, but could cause memory copy to be called with
zero length and/or NULL source/destination.

Sponsored by: Sippy Software, Inc.
Debugging: mpatrol

Maxim Sobolev 17 years ago
parent
commit
63266ebb7e
1 changed files with 2 additions and 1 deletions
  1. 2 1
      md5utils.c

+ 2 - 1
md5utils.c

@@ -78,7 +78,8 @@ void MDStringArray (char *dst, str src[], int size)
 		fprintf(stderr, " [%d]\n", sum );	
 #		endif
 */
-  		MDUpdate (&context, s, len);
+		if (len > 0)
+  			MDUpdate (&context, s, len);
   }
   MDFinal (digest, &context);