GNOME Bugzilla – Bug 348063
_gtk_icon_cache_get_icon crashes when no cache available
Last modified: 2006-07-20 18:07:27 UTC
Steps to reproduce: I've been hitting this since I installed wireshark on an otherwise mostly KDE system Stack trace: 0 find_image_offset (cache=0x0, icon_name=0x2ae2173963c6 "gtk-missing-image", directory=0x2ae2173963c3 "24") at gtkiconcache.c:219
+ Trace 69456
Other information: The problem relies actually in find_image_offset, that dereferences almost immediately the cache pointer parameter it is given, without doing any check for its validity. But the problem seems to rely after all on _gtk_icon_cache_get_icon, one call above, that should check for the cache parameter given to it. I'm going to attach a simple patch that seems to solve the problem to me, although it might require to add a GTK_NOTE message or something.. I'm not used to gtk's code so I can't tell. HTH, Diego
Created attachment 69208 [details] [review] gtk+-2.10.0-nullpointer.patch
2006-07-20 Matthias Clasen <mclasen@redhat.com> * gtk/gtkicontheme.h: * gtk/gtkicontheme.c (_gtk_icon_theme_ensure_builtin_cache): Export this privately. * gtk/gtkiconfactory.c (render_fallback_image): And call it here to initialize the builtin cache before using it. (#348063, Diego Pettenò)