Explorar o código

Fix a memory violation in objdb (caught by valgrind)

If the new length is larger then memory will be overwritten.

I could make this ">=" but we can save memory if the new size is smaller by using "!=".



git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@1680 fd59a12c-fef9-0310-b244-a6a79926bd2f
Angus Salkeld %!s(int64=17) %!d(string=hai) anos
pai
achega
3bc868eb54
Modificáronse 1 ficheiros con 1 adicións e 1 borrados
  1. 1 1
      exec/objdb.c

+ 1 - 1
exec/objdb.c

@@ -1085,7 +1085,7 @@ static int object_key_replace (
 			}
 		}
 
-		if (new_value_len <= object_key->value_len) {
+		if (new_value_len != object_key->value_len) {
 			void *replacement_value;
 			replacement_value = malloc(new_value_len);
 			if (!replacement_value)