summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCyrille Bagard <nocbos@gmail.com>2015-04-30 23:35:19 (GMT)
committerCyrille Bagard <nocbos@gmail.com>2015-04-30 23:35:19 (GMT)
commit08adf78fbff30d213891a533fbf43d91816b166a (patch)
tree65f976e49f9fe3a1881caa304bcd8f395d36e6da
parentbec7fe8b2840838fe3a2620b8af29264d8b54e60 (diff)
Recovered from parsing errors against an empty XML file.
git-svn-id: svn://svn.gna.org/svn/chrysalide/trunk@524 abbe820e-26c8-41b2-8c08-b7b2b41f8b0a
-rw-r--r--ChangeLog5
-rw-r--r--src/common/xml.c10
2 files changed, 14 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index b10dc29..3349302 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
15-05-01 Cyrille Bagard <nocbos@gmail.com>
+ * src/common/xml.c:
+ Recover from parsing errors against an empty XML file.
+
+15-05-01 Cyrille Bagard <nocbos@gmail.com>
+
* plugins/mobicore/mclf.c:
* src/analysis/db/cdb.c:
* src/format/dex/dex.c:
diff --git a/src/common/xml.c b/src/common/xml.c
index d01ae9b..1e2871b 100644
--- a/src/common/xml.c
+++ b/src/common/xml.c
@@ -145,7 +145,15 @@ void close_xml_file(xmlDocPtr xdoc, xmlXPathContextPtr context)
gboolean open_xml_file(const char *filename, xmlDoc **xdoc, xmlXPathContextPtr *xpathCtx)
{
- *xdoc = xmlParseFile(filename);
+ /**
+ * On s'autorise à récupérer des erreurs de fichier vide, ie ne contenant que :
+ *
+ * <?xml version="1.0" encoding="UTF-8"?>
+ *
+ * On espère que la récupération d'autres situations d'erreurs est bien gérée.
+ */
+
+ *xdoc = xmlReadFile(filename, NULL, XML_PARSE_RECOVER);
if (*xdoc == NULL)
{