1 Star 0 Fork 52

冉召宇/third_party_libxml2_1

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
backport-reader-Switch-to-xmlParserInputBufferCreateMem.patch 1.36 KB
一键复制 编辑 原始数据 按行查看 历史
冉召宇 提交于 2024-04-25 19:13 +08:00 . libxml2切openEuler7.0
From 800bb118a5cb30232a295b89df8cb749eece49af Mon Sep 17 00:00:00 2001
From: Nick Wellnhofer <wellnhofer@aevum.de>
Date: Mon, 14 Nov 2022 22:00:50 +0100
Subject: [PATCH 16/28] reader: Switch to xmlParserInputBufferCreateMem
This is less efficient but can't result in input buffer overreads.
Fixes #326.
Reference: https://github.com/GNOME/libxml2/commit/1ca0dfec351a089537127911607c5e89bc937840
Conflict: NA
---
xmlreader.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/xmlreader.c b/xmlreader.c
index 989b7c1..ac97bde 100644
--- a/xmlreader.c
+++ b/xmlreader.c
@@ -5508,8 +5508,7 @@ xmlReaderForMemory(const char *buffer, int size, const char *URL,
xmlTextReaderPtr reader;
xmlParserInputBufferPtr buf;
- buf = xmlParserInputBufferCreateStatic(buffer, size,
- XML_CHAR_ENCODING_NONE);
+ buf = xmlParserInputBufferCreateMem(buffer, size, XML_CHAR_ENCODING_NONE);
if (buf == NULL) {
return (NULL);
}
@@ -5735,7 +5734,7 @@ xmlReaderNewMemory(xmlTextReaderPtr reader, const char *buffer, int size,
if (buffer == NULL)
return (-1);
- input = xmlParserInputBufferCreateStatic(buffer, size,
+ input = xmlParserInputBufferCreateMem(buffer, size,
XML_CHAR_ENCODING_NONE);
if (input == NULL) {
return (-1);
--
2.27.0
Loading...
马建仓 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

搜索帮助