[gupnp/gupnp-0.18] Don't use xmlRecoverFile, use xmlReadFile



commit 4a0ec895b98916526ee4b1271c4754ff41da67c2
Author: Jens Georg <mail jensge org>
Date:   Sat Jun 30 21:13:26 2012 +0200

    Don't use xmlRecoverFile, use xmlReadFile
    
    xmlRecoverFile never errors out (returning a non-null file). So invalid
    XML files can't be detected.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=679204

 libgupnp/gupnp-xml-doc.c |    4 +++-
 1 files changed, 3 insertions(+), 1 deletions(-)
---
diff --git a/libgupnp/gupnp-xml-doc.c b/libgupnp/gupnp-xml-doc.c
index 6f83c0e..8d712a9 100644
--- a/libgupnp/gupnp-xml-doc.c
+++ b/libgupnp/gupnp-xml-doc.c
@@ -104,7 +104,9 @@ gupnp_xml_doc_new_from_path (const char *path,
         xmlDoc *doc;
 
         g_return_val_if_fail (path != NULL, NULL);
-        doc = xmlRecoverFile (path);
+        doc = xmlReadFile (path,
+                           NULL,
+                           XML_PARSE_PEDANTIC);
         if (doc == NULL) {
                 g_set_error (error,
                              GUPNP_XML_ERROR,



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]