1 Star 0 Fork 48

冉召宇/third_party_libxml2_1

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
backport-Fix-use-after-free-in-xmlParseContentInternal.patch 1.00 KB
一键复制 编辑 原始数据 按行查看 历史
冉召宇 提交于 2024-04-25 19:13 . libxml2切openEuler7.0
From 86105c0493f19ef8e1dd21ab5099613159224b4d Mon Sep 17 00:00:00 2001
From: David Kilzer <ddkilzer@apple.com>
Date: Sat, 15 Apr 2023 18:04:03 -0700
Subject: [PATCH] Fix use-after-free in xmlParseContentInternal()
* parser.c:
(xmlParseCharData):
- Check if the parser has stopped before advancing
`ctxt->input->cur`. This only occurs if a custom SAX error
handler calls xmlStopParser() on fatal errors.
Fixes #518.
Reference:https://github.com/GNOME/libxml2/commit/86105c0493f19ef8e1dd21ab5099613159224b4d
Conflict:parser.c
---
parser.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/parser.c b/parser.c
index f9b4012..ccddf07 100644
--- a/parser.c
+++ b/parser.c
@@ -4504,7 +4504,8 @@ get_more:
if (*in == ']') {
if ((in[1] == ']') && (in[2] == '>')) {
xmlFatalErr(ctxt, XML_ERR_MISPLACED_CDATA_END, NULL);
- ctxt->input->cur = in + 1;
+ if (ctxt->instate != XML_PARSER_EOF)
+ ctxt->input->cur = in + 1;
return;
}
in++;
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/ran-zhao-yu/third_party_libxml2_1.git
git@gitee.com:ran-zhao-yu/third_party_libxml2_1.git
ran-zhao-yu
third_party_libxml2_1
third_party_libxml2_1
master

搜索帮助