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
This commit is contained in:
Angus Salkeld 2008-10-30 19:32:23 +00:00
parent c08559c0ba
commit 3bc868eb54

View File

@ -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)