]> git.pld-linux.org Git - packages/libxml2.git/blob - libxml2-fix-relaxed-approach-to-nested-documents.patch
- merged Fedora patches (python3-unicode-errors,fix-relaxed-approach-to-nested-docume...
[packages/libxml2.git] / libxml2-fix-relaxed-approach-to-nested-documents.patch
1 From 0815302dee2b78139832c2080348086a0564836b Mon Sep 17 00:00:00 2001
2 From: Nick Wellnhofer <wellnhofer@aevum.de>
3 Date: Fri, 6 Dec 2019 12:27:29 +0100
4 Subject: [PATCH] Fix freeing of nested documents
5
6 Apparently, some libxslt RVTs can contain nested document nodes, see
7 issue #132. I'm not sure how this happens exactly but it can cause a
8 segfault in xmlFreeNodeList after the changes in commit 0762c9b6.
9
10 Make sure not to touch the (nonexistent) `content` member of xmlDocs.
11 ---
12  tree.c | 5 +++++
13  1 file changed, 5 insertions(+)
14
15 diff --git a/tree.c b/tree.c
16 index 070670f1..0d7fc98c 100644
17 --- a/tree.c
18 +++ b/tree.c
19 @@ -3708,6 +3708,11 @@ xmlFreeNodeList(xmlNodePtr cur) {
20                 (cur->type != XML_XINCLUDE_START) &&
21                 (cur->type != XML_XINCLUDE_END) &&
22                 (cur->type != XML_ENTITY_REF_NODE) &&
23 +               (cur->type != XML_DOCUMENT_NODE) &&
24 +#ifdef LIBXML_DOCB_ENABLED
25 +               (cur->type != XML_DOCB_DOCUMENT_NODE) &&
26 +#endif
27 +               (cur->type != XML_HTML_DOCUMENT_NODE) &&
28                 (cur->content != (xmlChar *) &(cur->properties))) {
29                 DICT_FREE(cur->content)
30             }
31 -- 
32 2.22.0
33
This page took 0.04695 seconds and 3 git commands to generate.