Possible fix for issue #206

- handle bad xml data from Amazon



git-svn-id: http://s3fs.googlecode.com/svn/trunk@355 df820570-a93a-0410-bd06-b72b767a4274
This commit is contained in:
ben.lemasurier@gmail.com 2011-07-28 15:43:52 +00:00
parent b54b2ddfda
commit 40fde1e0ea

View File

@ -2479,7 +2479,9 @@ static int s3fs_readdir(
cout << "readdir[path=" << path << "]" << endl;
// get a list of all the objects
list_bucket(path, &head);
if((list_bucket(path, &head)) != 0)
return -EIO;
if(head == NULL)
return 0;
@ -2768,6 +2770,9 @@ static int append_objects_from_xml(const char *xml, struct s3_object **head) {
xmlNodeSetPtr content_nodes;
doc = xmlReadMemory(xml, strlen(xml), "", NULL, 0);
if(doc == NULL)
return -1;
ctx = xmlXPathNewContext(doc);
xmlXPathRegisterNs(ctx, (xmlChar *) "s3",
(xmlChar *) "http://s3.amazonaws.com/doc/2006-03-01/");