1 Star 0 Fork 52

冉召宇/third_party_libxml2_1

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
backport-buf-Fix-return-value-of-xmlBufGetInputBase.patch 850 Bytes
一键复制 编辑 原始数据 按行查看 历史
冉召宇 提交于 11个月前 . libxml2切openEuler7.0
From f8c5e7fb75cd741fb576ddb4de8fcd61f9907549 Mon Sep 17 00:00:00 2001
From: Nick Wellnhofer <wellnhofer@aevum.de>
Date: Sun, 22 Jan 2023 13:49:19 +0100
Subject: [PATCH] buf: Fix return value of xmlBufGetInputBase
Don't return (size_t) -1 in error case.
Found with libFuzzer and -fsanitize=implicit-conversion.
Reference:https://github.com/GNOME/libxml2/commit/f8c5e7fb75cd741fb576ddb4de8fcd61f9907549
Conflict:NA
---
buf.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/buf.c b/buf.c
index 69370b7..d8992f7 100644
--- a/buf.c
+++ b/buf.c
@@ -1283,7 +1283,7 @@ xmlBufGetInputBase(xmlBufPtr buf, xmlParserInputPtr input) {
size_t base;
if ((input == NULL) || (buf == NULL) || (buf->error))
- return(-1);
+ return(0);
CHECK_COMPAT(buf)
base = input->base - buf->content;
/*
--
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

搜索帮助