cluster: STABLE32 - ccs: Don't truncate lists

Christine Caulfield chrissie at fedoraproject.org
Tue Aug 14 12:54:01 UTC 2012


Gitweb:        http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=cfa17970cce1d850912a7cdacf29bc8492b124e6
Commit:        cfa17970cce1d850912a7cdacf29bc8492b124e6
Parent:        c8b37b3f2971b76cd8ead80c23e02745126c9493
Author:        Christine Caulfield <ccaulfie at redhat.com>
AuthorDate:    Tue Aug 14 13:53:00 2012 +0100
Committer:     Christine Caulfield <ccaulfie at redhat.com>
CommitterDate: Tue Aug 14 13:53:00 2012 +0100

ccs: Don't truncate lists

The last ccs patch caused ccs_get_list to return trunated items due to datalen not being filled in
with the new cconfdb API. This fixes that.

Also add a missing pointer NULL that could have resulted in corrupted memory

Signed-off-by: Christine Caulfield <ccaulfie at redhat.com>
---
 config/libs/libccsconfdb/xpathlite.c |    5 ++++-
 1 files changed, 4 insertions(+), 1 deletions(-)

diff --git a/config/libs/libccsconfdb/xpathlite.c b/config/libs/libccsconfdb/xpathlite.c
index db986e3..e57b5c7 100644
--- a/config/libs/libccsconfdb/xpathlite.c
+++ b/config/libs/libccsconfdb/xpathlite.c
@@ -333,9 +333,12 @@ static int get_data(confdb_handle_t handle, hdb_handle_t connection_handle,
 			}
 
 			value--;
-			if (value != 0)
+			if (value != 0) {
 				free(keyval);
+				keyval = NULL;
+			}
 		}
+		datalen = strlen(data);
 		resval = malloc(datalen + keyvallen + 2);
 		if (!resval)
 			goto fail;


More information about the cluster-commits mailing list