加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0204-blscfg-don-t-leak-bls_entry.filename.patch 881 Bytes
一键复制 编辑 原始数据 按行查看 历史
geliwei 提交于 2022-04-13 15:15 . update to grub2-2.02-120.el8.src.rpm
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Will Thompson <wjt@endlessm.com>
Date: Thu, 12 Jul 2018 10:59:10 +0100
Subject: [PATCH] blscfg: don't leak bls_entry.filename
Zeroing the bls_entry struct before calling grub_free() on one of its
fields is not going to work too well.
Signed-off-by: Will Thompson <wjt@endlessm.com>
---
grub-core/commands/blscfg.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/grub-core/commands/blscfg.c b/grub-core/commands/blscfg.c
index a45f40fe6..11a356de8 100644
--- a/grub-core/commands/blscfg.c
+++ b/grub-core/commands/blscfg.c
@@ -166,8 +166,8 @@ static void bls_free_entry(struct bls_entry *entry)
}
grub_free (entry->keyvals);
- grub_memset (entry, 0, sizeof (*entry));
grub_free (entry->filename);
+ grub_memset (entry, 0, sizeof (*entry));
grub_free (entry);
}
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化