grub2/0220-gfxmenu-icon_manager-Fix-null-pointer-dereference.patch
Peter Jones 8c6b1ac71e Reconcile with upstream once again.
Also include some minor fixes for gcc 5.1.1

Signed-off-by: Peter Jones <pjones@redhat.com>
2015-07-22 09:46:32 -04:00

31 lines
1.1 KiB
Diff

From bd74a925e5026cd0368b3455df8ffcf0b1b4150b Mon Sep 17 00:00:00 2001
From: Vladimir Serbinenko <phcoder@gmail.com>
Date: Mon, 26 Jan 2015 09:37:01 +0100
Subject: [PATCH 220/506] gfxmenu/icon_manager: Fix null pointer dereference.
Found by: Coverity scan.
---
grub-core/gfxmenu/icon_manager.c | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/grub-core/gfxmenu/icon_manager.c b/grub-core/gfxmenu/icon_manager.c
index ff49ab0..1894682 100644
--- a/grub-core/gfxmenu/icon_manager.c
+++ b/grub-core/gfxmenu/icon_manager.c
@@ -106,8 +106,10 @@ grub_gfxmenu_icon_manager_set_theme_path (grub_gfxmenu_icon_manager_t mgr,
const char *path)
{
/* Clear the cache if the theme path has changed. */
- if (((mgr->theme_path == 0) != (path == 0))
- || (grub_strcmp (mgr->theme_path, path) != 0))
+ if (mgr->theme_path == 0 && path == 0)
+ return;
+ if (mgr->theme_path == 0 || path == 0
+ || grub_strcmp (mgr->theme_path, path) != 0)
grub_gfxmenu_icon_manager_clear_cache (mgr);
grub_free (mgr->theme_path);
--
2.4.3