[libxml++] Patch for libxml++-1.0.5



Hi!

Please include my little patch into 1.0 branch (if possible). It fixes coredump during try of reporting parse error in DomParser::parse_context.
To reproduce coredump one should try to parse XML document with incorrect encoding; it happens on 1.0.5 only:

std::string xml_doc =
    "<?xml version=\"1.0\" encoding=\"unknown-122\"?>"
    "<root/>";

xmlpp::DomParser parser;
parser.set_substitute_entities ();
 
--
Anton Dedov
--- libxml++/parsers/domparser.cc.old	2006-11-02 16:06:34.000000000 +0600
+++ libxml++/parsers/domparser.cc	2006-11-02 16:06:51.000000000 +0600
@@ -98,9 +98,9 @@ void DomParser::parse_context()
 
   if(context_->errNo != 0)
   {
-    release_underlying();
     std::ostringstream o;
     o << "libxml error " << context_->errNo;
+    release_underlying();
     throw parse_error(o.str());
   }
 


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