• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1From d0c3f01e110d54415611c5fa0040cdf4a56053f9 Mon Sep 17 00:00:00 2001
2From: Nick Wellnhofer <wellnhofer@aevum.de>
3Date: Sat, 6 May 2023 17:47:37 +0200
4Subject: [PATCH] parser: Fix old SAX1 parser with custom callbacks
5
6For some reason, xmlCtxtUseOptionsInternal set the start and end element
7SAX handlers to the internal DOM builder functions when XML_PARSE_SAX1
8was specified. This means that custom SAX handlers could never work with
9that flag because these functions would receive the wrong user data
10argument and crash immediately.
11
12Fixes #535.
13
14Reference:https://github.com/GNOME/libxml2/commit/d0c3f01e110d54415611c5fa0040cdf4a56053f9
15Conflict:NA
16
17---
18 parser.c | 2 --
19 1 file changed, 2 deletions(-)
20
21diff --git a/parser.c b/parser.c
22index 94a6298..f9b4012 100644
23--- a/parser.c
24+++ b/parser.c
25@@ -15074,8 +15074,6 @@ xmlCtxtUseOptionsInternal(xmlParserCtxtPtr ctxt, int options, const char *encodi
26     }
27 #ifdef LIBXML_SAX1_ENABLED
28     if (options & XML_PARSE_SAX1) {
29-        ctxt->sax->startElement = xmlSAX2StartElement;
30-        ctxt->sax->endElement = xmlSAX2EndElement;
31         ctxt->sax->startElementNs = NULL;
32         ctxt->sax->endElementNs = NULL;
33         ctxt->sax->initialized = 1;
34--
352.27.0
36
37