From 3bc868eb5458179eec78f95fa95d137d001cbae0 Mon Sep 17 00:00:00 2001 From: Angus Salkeld Date: Thu, 30 Oct 2008 19:32:23 +0000 Subject: [PATCH] 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 --- exec/objdb.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/exec/objdb.c b/exec/objdb.c index 1cfcddfc..b0b60bbc 100644 --- a/exec/objdb.c +++ b/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)