cluster: RHEL6 - ccs: Don't truncate lists

Fabio M. Di Nitto fabbione at fedoraproject.org
Tue Aug 21 06:46:58 UTC 2012


Gitweb:        http://git.fedorahosted.org/git/?p=cluster.git;a=commitdiff;h=bb0daf4c52d18205b0c57448f7ee160d29fed90c
Commit:        bb0daf4c52d18205b0c57448f7ee160d29fed90c
Parent:        21548c1fde6ccfd160484b72bb75eb98b17f4835
Author:        Christine Caulfield <ccaulfie at redhat.com>
AuthorDate:    Tue Aug 14 13:53:00 2012 +0100
Committer:     Fabio M. Di Nitto <fdinitto at redhat.com>
CommitterDate: Tue Aug 21 08:46:25 2012 +0200

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

Resolves: rhbz#847234

Signed-off-by: Christine Caulfield <ccaulfie at redhat.com>
Signed-off-by: Fabio M. Di Nitto <fdinitto 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 75c33bc..0d770da 100644
--- a/config/libs/libccsconfdb/xpathlite.c
+++ b/config/libs/libccsconfdb/xpathlite.c
@@ -323,9 +323,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