Bug 409101 – invalid read to gtkicontheme.c insert_theme(), might cause
authorChris Wilson <chris@chris-wilson.co.uk>
Mon, 26 Feb 2007 14:09:21 +0000 (14:09 +0000)
committerChris Wilson <cpwilson@src.gnome.org>
Mon, 26 Feb 2007 14:09:21 +0000 (14:09 +0000)
2007-02-26  Chris Wilson  <chris@chris-wilson.co.uk>

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=/trunk/; revision=17353

ChangeLog
gtk/gtkicontheme.c

index 909bc257a10619c11a4b8e0a836d78d5ff6b8b19..e41da540c5f42e9cd74db07565809082bc9352c1 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2007-02-26  Chris Wilson  <chris@chris-wilson.co.uk>
+
+       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-26  Tor Lillqvist  <tml@novell.com>
 
        * gdk/win32/gdkwindow-win32.c (gdk_window_set_icon_name): Add
index 2e404e788f4063938ece249c95e33fb58502e468..3133935a214ee8aafc6c04dea36b1a3d7e59bfcf 100644 (file)
@@ -2203,8 +2203,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);