Index: libxfcegui4/libxfcegui4/xfce-appmenuitem.c =================================================================== RCS file: /var/cvs/xfce/xfce4/libxfcegui4/libxfcegui4/xfce-appmenuitem.c,v retrieving revision 1.29 retrieving revision 1.31 diff -u -r1.29 -r1.31 --- libxfcegui4/libxfcegui4/xfce-appmenuitem.c 22 Sep 2004 03:50:30 -0000 1.29 +++ libxfcegui4/libxfcegui4/xfce-appmenuitem.c 17 Oct 2004 09:22:10 -0000 1.31 @@ -444,7 +444,7 @@ * xfce_app_menu_item_new_from_desktop_entry: * @entry: An #XfceDesktopEntry describing the menu item to create. * @show_icon: Sets whether or not to show an icon in the menu item. - * @returns: A new #XfceAppMenuItem. + * @returns: A new #XfceAppMenuItem, or %NULL on error. * * Creates a new #XfceAppMenuItem using parameters from the application * specified in a #XfceDesktopEntry object. This has the effect of calling @@ -487,6 +487,12 @@ g_free(tmp); } app_menu_item->priv->name = name; + if(!g_utf8_validate(name, -1, NULL)) { + g_warning("XfceAppMenuItem: 'name' failed utf8 validation for .desktop file '%s'", + xfce_desktop_entry_get_file(entry)); + gtk_widget_destroy(GTK_WIDGET(app_menu_item)); + return NULL; + } accel_label = gtk_accel_label_new(app_menu_item->priv->name); gtk_misc_set_alignment(GTK_MISC(accel_label), 0.0, 0.5); Index: xfdesktop/modules/menu/desktop-menu-dentry.c =================================================================== RCS file: /var/cvs/xfce/xfce4/xfdesktop/modules/menu/desktop-menu-dentry.c,v retrieving revision 1.31 retrieving revision 1.33 diff -u -r1.31 -r1.33 --- xfdesktop/modules/menu/desktop-menu-dentry.c 22 Sep 2004 07:20:08 -0000 1.31 +++ xfdesktop/modules/menu/desktop-menu-dentry.c 17 Oct 2004 09:21:18 -0000 1.33 @@ -186,7 +186,7 @@ GtkWidget *mi = NULL, *parent = NULL, *submenu, *img; GdkPixbuf *pix = NULL; gchar *tmppath, *p, *q; - const gchar *icon; + const gchar *icon = NULL; gint menu_pos; BD("%s", path); @@ -321,10 +321,13 @@ menu = _ensure_path(desktop_menu, path); mi = xfce_app_menu_item_new_from_desktop_entry(de, desktop_menu->use_menu_icons); + if(!mi) + goto cleanup; name = xfce_app_menu_item_get_name(XFCE_APP_MENU_ITEM(mi)); g_snprintf(tmppath, 2048, "%s/%s", path, name); if(desktop_menu->menu_entry_hash && - g_hash_table_lookup(desktop_menu->menu_entry_hash, tmppath)) { + g_hash_table_lookup(desktop_menu->menu_entry_hash, tmppath)) + { gtk_widget_destroy(mi); goto cleanup; } @@ -353,10 +356,13 @@ menu = _ensure_path(desktop_menu, path); mi = xfce_app_menu_item_new_from_desktop_entry(de, desktop_menu->use_menu_icons); + if(!mi) + goto cleanup; name = xfce_app_menu_item_get_name(XFCE_APP_MENU_ITEM(mi)); g_snprintf(tmppath, 2048, "%s/%s", path, name); if(desktop_menu->menu_entry_hash && - g_hash_table_lookup(desktop_menu->menu_entry_hash, tmppath)) { + g_hash_table_lookup(desktop_menu->menu_entry_hash, tmppath)) + { gtk_widget_destroy(mi); goto cleanup; } @@ -386,10 +392,13 @@ menu = _ensure_path(desktop_menu, path); mi = xfce_app_menu_item_new_from_desktop_entry(de, desktop_menu->use_menu_icons); + if(!mi) + goto cleanup; name = xfce_app_menu_item_get_name(XFCE_APP_MENU_ITEM(mi)); g_snprintf(tmppath, 2048, "%s/%s", path, name); if(desktop_menu->menu_entry_hash && - g_hash_table_lookup(desktop_menu->menu_entry_hash, tmppath)) { + g_hash_table_lookup(desktop_menu->menu_entry_hash, tmppath)) + { gtk_widget_destroy(mi); g_free(path); path = NULL; @@ -550,7 +559,7 @@ MenuPathType pathtype, gboolean do_legacy) { gint i, totdirs = 0; - gchar **dentry_paths, *catfile, *kdepath, *homepath; + gchar **dentry_paths, *catfile, *kdepath = NULL, *homepath; const gchar *pathd, *kdedir = g_getenv("KDEDIR"); GDir *d; struct stat st;