mirror of
https://git.proxmox.com/git/mirror_corosync
synced 2025-08-14 05:46:19 +00:00
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:
parent
c08559c0ba
commit
3bc868eb54
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user