]> git.ipfire.org Git - thirdparty/grub.git/commitdiff
gfxmenu/icon_manager: Fix null pointer dereference.
authorVladimir Serbinenko <phcoder@gmail.com>
Mon, 26 Jan 2015 08:37:01 +0000 (09:37 +0100)
committerVladimir Serbinenko <phcoder@gmail.com>
Mon, 26 Jan 2015 08:37:01 +0000 (09:37 +0100)
Found by: Coverity scan.

grub-core/gfxmenu/icon_manager.c

index ff49ab0e0f62f8cd8347e24b50cb3be384b34154..1894682efdf3d70c303e39c6c3867096434a75e7 100644 (file)
@@ -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);