After an evaluation, GNOME has moved from Bugzilla to GitLab. Learn more about GitLab.
No new issues can be reported in GNOME Bugzilla anymore.
To report an issue in a GNOME project, go to GNOME GitLab.
Do not go to GNOME Gitlab for: Bluefish, Doxygen, GnuCash, GStreamer, java-gnome, LDTP, NetworkManager, Tomboy.
Bug 664456 - segfault on arrow keypress in empty GtkIconView
segfault on arrow keypress in empty GtkIconView
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: GtkIconView
3.0.x
Other Linux
: Normal critical
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2011-11-21 08:44 UTC by Kalle Olavi Niemitalo
Modified: 2011-11-23 22:52 UTC
See Also:
GNOME target: ---
GNOME version: 2.91/3.0


Attachments
GtkIconView: Fix a segfault (1.92 KB, patch)
2011-11-23 22:52 UTC, Matthias Clasen
committed Details | Review

Description Kalle Olavi Niemitalo 2011-11-21 08:44:30 UTC
In gtk/gtkiconview.c, gtk_icon_view_move_cursor_left_right and gtk_icon_view_move_cursor_up_down set item = NULL if the icon view has no items.  They then call gtk_icon_view_set_cell_data (icon_view, item), which tries to read either item->index or item->iter, and therefore crashes with SIGSEGV.

http://git.gnome.org/browse/gtk+/tree/gtk/gtkiconview.c?id=54d6ef115b364edfebaaa67cc584006adaf499dc#n3772
http://git.gnome.org/browse/gtk+/tree/gtk/gtkiconview.c?id=54d6ef115b364edfebaaa67cc584006adaf499dc#n3917
http://git.gnome.org/browse/gtk+/tree/gtk/gtkiconview.c?id=54d6ef115b364edfebaaa67cc584006adaf499dc#n4222

Reproduceable as follows:

Start cheese 3.0.1-2.  It is in photo mode by default.  Click on the empty pane where photos would appear if you took any.  Press the Right arrow key.  The process dies with SIGSEGV.  (This crash does not occur if you do have any photos in the pane.)

Please see http://bugs.debian.org/638704 for the backtrace and exact versions.  Although I expect it won't be necessary because the bug is evident from the source.

This bug is different from https://bugzilla.gnome.org/page.cgi?id=trace.html&trace_id=205506 because that one has item != NULL.
Comment 1 Matthias Clasen 2011-11-23 22:52:35 UTC
The following fix has been pushed:
b84d37a GtkIconView: Fix a segfault
Comment 2 Matthias Clasen 2011-11-23 22:52:38 UTC
Created attachment 202034 [details] [review]
GtkIconView: Fix a segfault

Keynav on an empty iconview was causing segfaults. This
was reported in