Browse code

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 authored on 21/10/2008 03:10:47
Showing 1 changed files
... ...
@@ -78,7 +78,8 @@ void MDStringArray (char *dst, str src[], int size)
78 78
 		fprintf(stderr, " [%d]\n", sum );	
79 79
 #		endif
80 80
 */
81
-  		MDUpdate (&context, s, len);
81
+		if (len > 0)
82
+  			MDUpdate (&context, s, len);
82 83
   }
83 84
   MDFinal (digest, &context);
84 85