[libxml2] Try to fix a problem with entities in SAX mode



commit 4aa68abb1ca0d1216b9820a610263abb522f3b98
Author: Daniel Veillard <veillard redhat com>
Date:   Mon Apr 2 17:50:54 2012 +0800

    Try to fix a problem with entities in SAX mode
    
    this is a problem which hit the raptor code and that small
    patch should be a reliable workaround

 parser.c |   10 ++++++++++
 1 files changed, 10 insertions(+), 0 deletions(-)
---
diff --git a/parser.c b/parser.c
index 72a467c..0770138 100644
--- a/parser.c
+++ b/parser.c
@@ -12429,6 +12429,16 @@ xmlParseCtxtExternalEntity(xmlParserCtxtPtr ctx, const xmlChar *URL,
     }
 
     /*
+     * If the user provided its own SAX callbacks then reuse the
+     * useData callback field, otherwise the expected setup in a
+     * DOM builder is to have userData == ctxt
+     */
+    if (ctx->userData == ctx)
+        ctxt->userData = ctxt;
+    else
+        ctxt->userData = ctx->userData;
+
+    /*
      * Doing validity checking on chunk doesn't make sense
      */
     ctxt->instate = XML_PARSER_CONTENT;



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