9 Star 1 Fork 30

src-openEuler/iptables

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-xtables-eb-fix-crash-when-opts-isn-t-reallocated.patch 878 Bytes
一键复制 编辑 原始数据 按行查看 历史
yangl777 提交于 2024-04-18 08:59 . backport some patches from upstream
From e900d40afdb731d2270a5110833ae49192974355 Mon Sep 17 00:00:00 2001
From: Florian Westphal <fw@strlen.de>
Date: Tue, 14 Mar 2023 22:36:50 +0100
Subject: [PATCH] xtables-eb: fix crash when opts isn't reallocated
opts may point to statically allocated memory.
This fixes abort() from libc.
Conflict: NA
Reference: https://git.netfilter.org/iptables/commit?id=e900d40afdb731d2270a5110833ae49192974355
Signed-off-by: Florian Westphal <fw@strlen.de>
---
iptables/xtables-eb.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/iptables/xtables-eb.c b/iptables/xtables-eb.c
index 3a73e797..068dffd2 100644
--- a/iptables/xtables-eb.c
+++ b/iptables/xtables-eb.c
@@ -675,7 +675,8 @@ void nft_fini_eb(struct nft_handle *h)
free(target->t);
}
- free(opts);
+ if (opts != ebt_original_options)
+ free(opts);
nft_fini(h);
xtables_fini();
--
2.23.0
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/src-openeuler/iptables.git
git@gitee.com:src-openeuler/iptables.git
src-openeuler
iptables
iptables
master

搜索帮助