加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
backport-malloc-fail-Fix-buffer-overread-with-HTML-doctype-de.patch 1.24 KB
一键复制 编辑 原始数据 按行查看 历史
冉召宇 提交于 2024-04-25 19:13 . libxml2切openEuler7.0
From 1061537efdf3874c91fd50d18f98c4b8a3518e52 Mon Sep 17 00:00:00 2001
From: Nick Wellnhofer <wellnhofer@aevum.de>
Date: Sun, 26 Mar 2023 22:40:54 +0200
Subject: [PATCH] malloc-fail: Fix buffer overread with HTML doctype
declarations
Found by OSS-Fuzz, see #344.
Reference:https://github.com/GNOME/libxml2/commit/1061537efdf3874c91fd50d18f98c4b8a3518e52
Conflict:NA
---
HTMLparser.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/HTMLparser.c b/HTMLparser.c
index 42d1b29..5e4f289 100644
--- a/HTMLparser.c
+++ b/HTMLparser.c
@@ -3008,9 +3008,9 @@ htmlParseSystemLiteral(htmlParserCtxtPtr ctxt) {
htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED,
"Unfinished SystemLiteral\n", NULL, NULL);
} else {
- NEXT;
if (err == 0)
ret = xmlStrndup((BASE_PTR+startPosition), len);
+ NEXT;
}
return(ret);
@@ -3063,9 +3063,9 @@ htmlParsePubidLiteral(htmlParserCtxtPtr ctxt) {
htmlParseErr(ctxt, XML_ERR_LITERAL_NOT_FINISHED,
"Unfinished PubidLiteral\n", NULL, NULL);
} else {
- NEXT;
if (err == 0)
ret = xmlStrndup((BASE_PTR + startPosition), len);
+ NEXT;
}
return(ret);
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化