! Please note that this is a snapshot of our old Bugzilla server, which is read only since May 29, 2020. Please go to gitlab.xfce.org for our new server !
Crash with non-existent custom menu file
Status:
RESOLVED: FIXED
Product:
Xfce4-panel
Component:
Applications Menu

Comments

Description Lionel Le Folgoc 2011-08-15 15:34:57 CEST
Hi,

Xfce4-panel 4.8.3, garcon 0.1.6

(I'm not sure it's a bug in xfce4-panel, this might be in garcon instead, feel free to reassign)

If the menu file pointed by the "custom menu file" entry doesn't exist (I know it's rather rare, but it can happen sometimes when migrating some 4.6 settings ;-), xfce4-panel might crash.

In plugins/applicationsmenu/applicationsmenu.c, applications_menu_plugin_menu(), there's the following code:

if (G_UNLIKELY (plugin->custom_menu
          && plugin->custom_menu_file != NULL))
        menu = garcon_menu_new_for_path (plugin->custom_menu_file);

      /* use the applications menu, this also respects the
       * XDG_MENU_PREFIX environment variable */
      if (G_LIKELY (menu == NULL))
        menu = garcon_menu_new_applications ();

but even if plugin->custom_menu_file doesn't exist, garcon_menu_new_for_path() won't return NULL (according to its api doc), so the panel will later try to generate a menu with a non-existing menu file and crash.

Maybe plugin->custom_menu_file should be checked before passing it to garcon? Or maybe the bug is in garcon_menu_load(), which doesn't handle well this case and crash the panel?

(sorry if this is already fixed in garcon/master).

Thanks.
Comment 1 Nick Schermer editbugs 2011-09-09 20:04:07 CEST
Fixed in a9b1ea4.
Comment 2 Nick Schermer editbugs 2011-09-09 20:13:48 CEST
In garcon 1fe36e1, the proper value is also returned, so the user knows what is going wrong.

Bug #7895

Reported by:
Lionel Le Folgoc
Reported on: 2011-08-15
Last modified on: 2011-09-09

People

Assignee:
Nick Schermer
CC List:
0 users

Version

Attachments

Additional information