telepathy-logger: Ask libxml2 to recover from errors of possible

Sjoerd Simons sjoerd at kemper.freedesktop.org
Mon Mar 3 01:48:44 PST 2014


Module: telepathy-logger
Branch: master
Commit: 734af806917d67dada9fc591da1673edfe1a8cdd
URL:    http://cgit.freedesktop.org/telepathy/telepathy-logger/commit/?id=734af806917d67dada9fc591da1673edfe1a8cdd

Author: Sjoerd Simons <sjoerd at luon.net>
Date:   Sun Jan  5 14:16:55 2014 +0100

Ask libxml2 to recover from errors of possible

Let libxml2 try and recover on parse error instead to avoid crashes in
case logs can't be parsed fully.

Works around https://bugs.freedesktop.org/show_bug.cgi?id=40675

---

 telepathy-logger/log-store-xml.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/telepathy-logger/log-store-xml.c b/telepathy-logger/log-store-xml.c
index fc2fbfd..c050224 100644
--- a/telepathy-logger/log-store-xml.c
+++ b/telepathy-logger/log-store-xml.c
@@ -1365,7 +1365,7 @@ log_store_xml_get_events_for_file (TplLogStoreXml *self,
   ctxt = xmlNewParserCtxt ();
 
   /* Parse and validate the file. */
-  doc = xmlCtxtReadFile (ctxt, filename, NULL, 0);
+  doc = xmlCtxtReadFile (ctxt, filename, NULL, XML_PARSE_RECOVER);
   if (!doc)
     {
       g_warning ("Failed to parse file:'%s'", filename);



More information about the telepathy-commits mailing list