1 Star 0 Fork 98

zjut_zy/grub2

forked from 余诗/grub2 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
backport-lib-relocator-Initialize-local-relocator-subchunk-struct-to.patch 1.45 KB
一键复制 编辑 原始数据 按行查看 历史
zhangqiumiao 提交于 2022-10-23 22:14 . backport some patches from upstream
From f7f453e0bf1043d89587638ffd24b8c34631b8eb Mon Sep 17 00:00:00 2001
From: Ross Philipson <[email protected]>
Date: Thu, 14 Jul 2022 09:41:28 -0400
Subject: lib/relocator: Initialize local relocator subchunk struct to all
zeros
The way the code is written the tofree variable would never be passed to
the free_subchunk() function uninitialized. Coverity cannot determine
this and flags the situation as "Using uninitialized value...". The fix
is just to initialize the local struct.
Fixes: CID 314016
Reference:https://git.savannah.gnu.org/cgit/grub.git/commit?id=f7f453e0bf1043d89587638ffd24b8c34631b8eb
Conflict:NA
Signed-off-by: Ross Philipson <[email protected]>
Reviewed-by: Darren Kenny <[email protected]>
Tested-by: Alec Brown <[email protected]>
Reviewed-by: Daniel Kiper <[email protected]>
---
grub-core/lib/relocator.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/grub-core/lib/relocator.c b/grub-core/lib/relocator.c
index 68ef128..bfcc70d 100644
--- a/grub-core/lib/relocator.c
+++ b/grub-core/lib/relocator.c
@@ -989,7 +989,7 @@ malloc_in_range (struct grub_relocator *rel,
if (j != 0 && events[j - 1].pos != events[j].pos)
{
grub_addr_t alloc_start, alloc_end;
- struct grub_relocator_subchunk tofree;
+ struct grub_relocator_subchunk tofree = {0};
struct grub_relocator_subchunk *curschu = &tofree;
if (!oom)
curschu = &res->subchunks[cural];
--
cgit v1.1
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化
1
https://gitee.com/zjuzy/grub2.git
[email protected]:zjuzy/grub2.git
zjuzy
grub2
grub2
master

搜索帮助