From 7884da3b1a53c9c4c66b9296acf91064a9add152 Mon Sep 17 00:00:00 2001 From: Chris Wilson Date: Mon, 26 Feb 2007 14:05:31 +0000 Subject: [PATCH] =?UTF-8?q?Bug=20409101=20=E2=80=93=20invalid=20read=20to?= =?UTF-8?q?=20gtkicontheme.c=20insert=5Ftheme(),=20might=20cause?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 2007-02-26 Chris Wilson Bug 409101 – invalid read to gtkicontheme.c insert_theme(), might cause gnome-panel crash * gtk/gtkicontheme.c: (scan_directory): Reorder the replacement of the shared base_name key, so that we avoid dereferencing the string in the icon_theme->all_icon hash table after freeing it from the dir->icons hash table. svn path=/branches/gtk-2-10/; revision=17352 --- ChangeLog | 9 +++++++++ gtk/gtkicontheme.c | 2 +- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 0a46d9a556..25e2e2c399 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2007-02-26 Chris Wilson + + Bug 409101 – invalid read to gtkicontheme.c insert_theme(), might cause gnome-panel crash + + * gtk/gtkicontheme.c: (scan_directory): + Reorder the replacement of the shared base_name key, so that we + avoid dereferencing the string in the icon_theme->all_icon + hash table after freeing it from the dir->icons hash table. + 2007-02-18 Matthias Clasen Merged from trunk: diff --git a/gtk/gtkicontheme.c b/gtk/gtkicontheme.c index 6c95ebf4b8..30d6423f9b 100644 --- a/gtk/gtkicontheme.c +++ b/gtk/gtkicontheme.c @@ -2207,8 +2207,8 @@ scan_directory (GtkIconThemePrivate *icon_theme, base_name = strip_suffix (name); hash_suffix = GPOINTER_TO_INT (g_hash_table_lookup (dir->icons, base_name)); - g_hash_table_replace (dir->icons, base_name, GUINT_TO_POINTER (hash_suffix| suffix)); g_hash_table_insert (icon_theme->all_icons, base_name, NULL); + g_hash_table_replace (dir->icons, base_name, GUINT_TO_POINTER (hash_suffix| suffix)); } g_dir_close (gdir);