1 Star 0 Fork 53

冉召宇/third_party_libxml2_1

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
backport-malloc-fail-Fix-error-code-in-htmlParseChunk.patch 1.04 KB
一键复制 编辑 原始数据 按行查看 历史
冉召宇 提交于 2024-04-25 19:13 +08:00 . libxml2切openEuler7.0
From 53d1cc98cf08c789087a92fd57da70811abe7d60 Mon Sep 17 00:00:00 2001
From: Nick Wellnhofer <wellnhofer@aevum.de>
Date: Thu, 16 Feb 2023 15:09:32 +0100
Subject: [PATCH] malloc-fail: Fix error code in htmlParseChunk
Found with libFuzzer, see #344.
Reference:https://github.com/GNOME/libxml2/commit/53d1cc98cf08c789087a92fd57da70811abe7d60
Conflict:NA
---
HTMLparser.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/HTMLparser.c b/HTMLparser.c
index 457b2a3..72ede56 100644
--- a/HTMLparser.c
+++ b/HTMLparser.c
@@ -6276,9 +6276,8 @@ htmlParseChunk(htmlParserCtxtPtr ctxt, const char *chunk, int size,
res = xmlParserInputBufferPush(ctxt->input->buf, size, chunk);
xmlBufSetInputBaseCur(ctxt->input->buf->buffer, ctxt->input, base, cur);
if (res < 0) {
- ctxt->errNo = XML_PARSER_EOF;
- ctxt->disableSAX = 1;
- return (XML_PARSER_EOF);
+ htmlErrMemory(ctxt, NULL);
+ return (ctxt->errNo);
}
#ifdef DEBUG_PUSH
xmlGenericError(xmlGenericErrorContext, "HPP: pushed %d\n", size);
--
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

搜索帮助