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