加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
backport-malloc-fail-Fix-another-memory-leak-in-xmlSchemaBuck.patch 919 Bytes
一键复制 编辑 原始数据 按行查看 历史
冉召宇 提交于 2024-04-25 19:13 . libxml2切openEuler7.0
From 260d6b8d77d11a20a2614eef99e88e68eaca6550 Mon Sep 17 00:00:00 2001
From: Nick Wellnhofer <wellnhofer@aevum.de>
Date: Sun, 5 Mar 2023 14:10:26 +0100
Subject: [PATCH] malloc-fail: Fix another memory leak in xmlSchemaBucketCreate
Found with libFuzzer, see #344.
Reference:https://github.com/GNOME/libxml2/commit/260d6b8d77d11a20a2614eef99e88e68eaca6550
Conflict:NA
---
xmlschemas.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/xmlschemas.c b/xmlschemas.c
index fa9d113..06bf664 100644
--- a/xmlschemas.c
+++ b/xmlschemas.c
@@ -3742,7 +3742,10 @@ xmlSchemaBucketCreate(xmlSchemaParserCtxtPtr pctxt,
return(NULL);
}
}
- xmlSchemaItemListAdd(mainSchema->includes, ret);
+ if (xmlSchemaItemListAdd(mainSchema->includes, ret) < 0) {
+ xmlSchemaBucketFree(ret);
+ return(NULL);
+ }
}
/*
* Add to list of all buckets; this is used for lookup
--
2.27.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化