From 8a9c1e1faf6e8cd24c49cf21053fb6581e04d43f Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Fri, 16 May 2008 00:46:15 +0000 Subject: [PATCH] fix a crash --- gnome-session.spec | 9 ++++++++- legacy-crash.patch | 29 +++++++++++++++++++++++++++++ 2 files changed, 37 insertions(+), 1 deletion(-) create mode 100644 legacy-crash.patch diff --git a/gnome-session.spec b/gnome-session.spec index cae9cb4..66ca583 100644 --- a/gnome-session.spec +++ b/gnome-session.spec @@ -12,7 +12,7 @@ Summary: GNOME session manager Name: gnome-session Version: 2.23.2.2 -Release: 1%{?dist} +Release: 2%{?dist} URL: http://www.gnome.org Source0: http://download.gnome.org/sources/gnome-session/2.23/%{name}-%{version}.tar.bz2 Source1: redhat-default-session @@ -53,6 +53,9 @@ Patch13: gnome-session-2.17.5-window-manager.patch # http://bugzilla.gnome.org/show_bug.cgi?id=475468 Patch22: ice-leaks.patch +# http://bugzilla.gnome.org/show_bug.cgi?id=533351 +Patch33: legacy-crash.patch + BuildRequires: libgnomeui-devel >= %{libgnomeui_version} BuildRequires: gtk2-devel >= %{gtk2_version} BuildRequires: dbus-devel >= %{dbus_version} @@ -95,6 +98,7 @@ GNOME components and handles logout and saving the session. #%patch20 -p1 -b .timeout #%patch21 -p0 -b .use-gdm-hints #%patch22 -p1 -b .ice-leaks +%patch33 -p1 -b .legacy-crash %build @@ -180,6 +184,9 @@ fi %changelog +* Thu May 15 2008 Matthias Clasen - 2.23.2.2-2 +- Don't crash while handling legacy sessions + * Wed May 14 2008 Matthias Clasen - 2.23.2.2-1 - Update to 2.23.2.2 diff --git a/legacy-crash.patch b/legacy-crash.patch new file mode 100644 index 0000000..df3ad35 --- /dev/null +++ b/legacy-crash.patch @@ -0,0 +1,29 @@ +diff -up gnome-session-2.23.2.2/gnome-session/session.c.legacy-crash gnome-session-2.23.2.2/gnome-session/session.c +--- gnome-session-2.23.2.2/gnome-session/session.c.legacy-crash 2008-05-15 19:46:02.000000000 -0400 ++++ gnome-session-2.23.2.2/gnome-session/session.c 2008-05-15 19:47:48.000000000 -0400 +@@ -152,8 +152,13 @@ out: + static void + append_app (GsmSession *session, GsmApp *app) + { +- const char *basename = gsm_app_get_basename (app); +- GsmApp *dup = g_hash_table_lookup (session->apps_by_name, basename); ++ const char *basename; ++ GsmApp *dup = NULL; ++ ++ basename = gsm_app_get_basename (app); ++ ++ if (basename) ++ dup = g_hash_table_lookup (session->apps_by_name, basename); + + if (dup) + { +@@ -163,7 +168,8 @@ append_app (GsmSession *session, GsmApp + } + + session->apps = g_slist_append (session->apps, app); +- g_hash_table_insert (session->apps_by_name, g_strdup (basename), app); ++ if (basename) ++ g_hash_table_insert (session->apps_by_name, g_strdup (basename), app); + } + + static void