From bc1cca69b307a0ea4b47e3dc611f5dd73fbcc725 Mon Sep 17 00:00:00 2001 From: Christine Caulfield Date: Tue, 15 Jun 2010 15:48:58 +0000 Subject: [PATCH] object_key_iter() calls object_key_iter_typed() and then always tries to dereference the string it returns, even if the call fails. The attached patch fixes this. git-svn-id: http://svn.fedorahosted.org/svn/corosync/trunk@2944 fd59a12c-fef9-0310-b244-a6a79926bd2f --- exec/objdb.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/exec/objdb.c b/exec/objdb.c index 8dc34c5e..c15ca869 100644 --- a/exec/objdb.c +++ b/exec/objdb.c @@ -1539,8 +1539,10 @@ static int object_key_iter(hdb_handle_t parent_object_handle, char *str; ret = object_key_iter_typed (parent_object_handle, (char**)key_name, value, value_len, &t); - str = *key_name; - *key_len = strlen(str); + if (!ret) { + str = *key_name; + *key_len = strlen(str); + } return ret; }