1 Star 0 Fork 48

hos-learning/third_party_libxml2

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
Fix-CVE-2023-45322-second.patch 1.18 KB
一键复制 编辑 原始数据 按行查看 历史
From 502971cc23e0ebb2677124b41b70c321c6dd5c02 Mon Sep 17 00:00:00 2001
From: Nick Wellnhofer <wellnhofer@aevum.de>
Date: Fri, 1 Dec 2023 17:49:48 +0100
Subject: [PATCH] tree: Another fix related to #538
Should fix #639.
---
tree.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/tree.c b/tree.c
index 35dabb97c..dc3ac4f92 100644
--- a/tree.c
+++ b/tree.c
@@ -4379,6 +4379,7 @@ xmlStaticCopyNodeList(xmlNodePtr node, xmlDocPtr doc, xmlNodePtr parent) {
xmlNodePtr ret = NULL;
xmlNodePtr p = NULL,q;
xmlDtdPtr newSubset = NULL;
+ int linkedSubset = 0;
while (node != NULL) {
#ifdef LIBXML_TREE_ENABLED
@@ -4395,6 +4396,7 @@ xmlStaticCopyNodeList(xmlNodePtr node, xmlDocPtr doc, xmlNodePtr parent) {
newSubset = (xmlDtdPtr) q;
xmlAddChild(parent, q);
} else {
+ linkedSubset = 1;
q = (xmlNodePtr) doc->intSubset;
xmlAddChild(parent, q);
}
@@ -4417,6 +4419,8 @@ xmlStaticCopyNodeList(xmlNodePtr node, xmlDocPtr doc, xmlNodePtr parent) {
doc->intSubset = newSubset;
return(ret);
error:
+ if (linkedSubset != 0)
+ xmlUnlinkNode((xmlNodePtr) doc->intSubset);
xmlFreeNodeList(ret);
return(NULL);
}
--
GitLab
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/hos-learning/third_party_libxml2.git
git@gitee.com:hos-learning/third_party_libxml2.git
hos-learning
third_party_libxml2
third_party_libxml2
master

搜索帮助