grub2/0118-Fix-one-more-coverity-complaint.patch
Petr Šabata 100e37f2e6 RHEL 9.0.0 Alpha bootstrap
The content of this branch was automatically imported from Fedora ELN
with the following as its source:
https://src.fedoraproject.org/rpms/grub2#f7e054f3d693af43a903faf33b70673f7aca4508
2020-10-15 09:48:35 +02:00

28 lines
912 B
Diff

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 596102848c1..c07100a8de3 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->fs_dir) (dev, dir, iterate_dir, NULL);