1 Star 0 Fork 83

lizhiqiang / grub2

forked from src-openEuler / grub2 
加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
0178-Fix-one-more-coverity-complaint.patch 909 Bytes
一键复制 编辑 原始数据 按行查看 历史
hexiaowen 提交于 2019-09-30 10:52 . Package init
From 0000000000000000000000000000000000000000 Mon Sep 17 00:00:00 2001
From: Peter Jones <pjones@redhat.com>
Date: Thu, 25 May 2017 11:27:40 -0400
Subject: [PATCH] Fix one more coverity complaint
No idea why covscan thinks this is an "added" bug, since the file hasn't
changed in 3 years, but... yeah.
Signed-off-by: Peter Jones <pjones@redhat.com>
---
grub-core/normal/completion.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/grub-core/normal/completion.c b/grub-core/normal/completion.c
index 2c9b9e9312a..93aa0d8eda8 100644
--- a/grub-core/normal/completion.c
+++ b/grub-core/normal/completion.c
@@ -284,7 +284,8 @@ complete_file (void)
/* Cut away the filename part. */
dirfile = grub_strrchr (dir, '/');
- dirfile[1] = '\0';
+ if (dirfile)
+ dirfile[1] = '\0';
/* Iterate the directory. */
(fs->dir) (dev, dir, iterate_dir, NULL);
1
https://gitee.com/unigis/grub2.git
git@gitee.com:unigis/grub2.git
unigis
grub2
grub2
master

搜索帮助

53164aa7 5694891 3bd8fe86 5694891