-
-
Notifications
You must be signed in to change notification settings - Fork 902
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix: apply upstream patch for in-context parsing
Fixes #3112
- Loading branch information
1 parent
3673f77
commit 41156b2
Showing
2 changed files
with
45 additions
and
0 deletions.
There are no files selected for viewing
33 changes: 33 additions & 0 deletions
33
patches/libxml2/0012-parser-Fix-crash-in-xmlParseInNodeContext-with-HTML.patch
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
From 95f2a17440568694a6df6a326c5b411e77597be2 Mon Sep 17 00:00:00 2001 | ||
From: Nick Wellnhofer <[email protected]> | ||
Date: Tue, 30 Jan 2024 13:25:17 +0100 | ||
Subject: [PATCH] parser: Fix crash in xmlParseInNodeContext with HTML | ||
documents | ||
|
||
Ignore namespaces if we have an HTML document with namespaces added | ||
manually. | ||
|
||
Fixes #672. | ||
--- | ||
parser.c | 4 +++- | ||
1 file changed, 3 insertions(+), 1 deletion(-) | ||
|
||
diff --git a/parser.c b/parser.c | ||
index 1038d71b..f7842ed1 100644 | ||
--- a/parser.c | ||
+++ b/parser.c | ||
@@ -12415,8 +12415,10 @@ xmlParseInNodeContext(xmlNodePtr node, const char *data, int datalen, | ||
} | ||
xmlAddChild(node, fake); | ||
|
||
- if (node->type == XML_ELEMENT_NODE) { | ||
+ if (node->type == XML_ELEMENT_NODE) | ||
nodePush(ctxt, node); | ||
+ | ||
+ if ((ctxt->html == 0) && (node->type == XML_ELEMENT_NODE)) { | ||
/* | ||
* initialize the SAX2 namespaces stack | ||
*/ | ||
-- | ||
2.42.0 | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters