nalika / rpms / grub2

Forked from rpms/grub2 2 years ago
Clone
27a4da
From 5b6796eb8c43c6d16fcb92cc1c5cb4351c4e7050 Mon Sep 17 00:00:00 2001
27a4da
From: Peter Jones <pjones@redhat.com>
27a4da
Date: Thu, 25 May 2017 11:27:40 -0400
27a4da
Subject: [PATCH 258/260] Fix one more coverity complaint
27a4da
27a4da
No idea why covscan thinks this is an "added" bug, since the file hasn't
27a4da
changed in 3 years, but... yeah.
27a4da
27a4da
Signed-off-by: Peter Jones <pjones@redhat.com>
27a4da
---
27a4da
 grub-core/normal/completion.c | 3 ++-
27a4da
 1 file changed, 2 insertions(+), 1 deletion(-)
27a4da
27a4da
diff --git a/grub-core/normal/completion.c b/grub-core/normal/completion.c
27a4da
index 2c9b9e931..93aa0d8ed 100644
27a4da
--- a/grub-core/normal/completion.c
27a4da
+++ b/grub-core/normal/completion.c
27a4da
@@ -284,7 +284,8 @@ complete_file (void)
27a4da
 
27a4da
       /* Cut away the filename part.  */
27a4da
       dirfile = grub_strrchr (dir, '/');
27a4da
-      dirfile[1] = '\0';
27a4da
+      if (dirfile)
27a4da
+	dirfile[1] = '\0';
27a4da
 
27a4da
       /* Iterate the directory.  */
27a4da
       (fs->dir) (dev, dir, iterate_dir, NULL);
27a4da
-- 
27a4da
2.13.0
27a4da