summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorNick Wellnhofer <wellnhofer@aevum.de>2023-05-06 17:47:37 +0200
committerNick Wellnhofer <wellnhofer@aevum.de>2023-05-06 17:47:37 +0200
commitd0c3f01e110d54415611c5fa0040cdf4a56053f9 (patch)
treec4f9ac68bae83d2a2efc990b94ae8ae8e0b38de0
parent06a2c251a18d8cc93bcae82270997b27cbc9aaea (diff)
downloadlibxml2-d0c3f01e110d54415611c5fa0040cdf4a56053f9.tar.gz
parser: Fix old SAX1 parser with custom callbacks
For some reason, xmlCtxtUseOptionsInternal set the start and end element SAX handlers to the internal DOM builder functions when XML_PARSE_SAX1 was specified. This means that custom SAX handlers could never work with that flag because these functions would receive the wrong user data argument and crash immediately. Fixes #535.
-rw-r--r--parser.c2
1 files changed, 0 insertions, 2 deletions
diff --git a/parser.c b/parser.c
index bb05791d..0c8bed12 100644
--- a/parser.c
+++ b/parser.c
@@ -14479,8 +14479,6 @@ xmlCtxtUseOptionsInternal(xmlParserCtxtPtr ctxt, int options, const char *encodi
}
#ifdef LIBXML_SAX1_ENABLED
if (options & XML_PARSE_SAX1) {
- ctxt->sax->startElement = xmlSAX2StartElement;
- ctxt->sax->endElement = xmlSAX2EndElement;
ctxt->sax->startElementNs = NULL;
ctxt->sax->endElementNs = NULL;
ctxt->sax->initialized = 1;