Skip to contentSkip to conversation

Stub crashes when listing

PATCH In review Pete Zaitcev 1 participant 1 message Dec 6, 2010 Library code

lore
Share & tools
lore
#0 lore raw

PATCH 2/2 Stub crashes when listing

Amazon managed to crash my tests again, by listing buckets that were created by ec2-upload-bundle. Let's stub a couple more places for now.

---
 lib/hstor.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

commit 69a23e09c3cd5ee41005b682d0472a5ccaa14d7d

Author: Pete Zaitcev <[email protected]>
Date:   Sun Dec 5 20:38:50 2010 -0700

Stub crash on list.

lib/hstor.c +2 -2
index 2892a5e..3f6c801 100644
@@ -969,12 +969,12 @@ struct hstor_keylist *hstor_keys(struct hstor_client *hstor, const char *bucket,
 		}
 		else if (!_strcmp(node->name, "Marker")) {
 			xs = xmlNodeListGetString(doc, node->children, 1);
-			keylist->marker = strdup((char *)xs);
+			keylist->marker = strdup(xs? (char *)xs: "");
 			xmlFree(xs);
 		}
 		else if (!_strcmp(node->name, "Delimiter")) {
 			xs = xmlNodeListGetString(doc, node->children, 1);
-			keylist->delim = strdup((char *)xs);
+			keylist->delim = strdup(xs? (char *)xs: "");
 			xmlFree(xs);
 		}
 		else if (!_strcmp(node->name, "MaxKeys")) {