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 775525 - gtk_flow_box_get_child_at_index shouldn't crash with an invalid index
gtk_flow_box_get_child_at_index shouldn't crash with an invalid index
Status: RESOLVED FIXED
Product: gtk+
Classification: Platform
Component: Widget: Other
3.22.x
Other All
: Normal normal
: ---
Assigned To: gtk-bugs
gtk-bugs
Depends on:
Blocks:
 
 
Reported: 2016-12-02 15:32 UTC by Debarshi Ray
Modified: 2016-12-02 18:19 UTC
See Also:
GNOME target: ---
GNOME version: ---


Attachments
flowbox: Fix get_child_at_index crash with an invalid index (804 bytes, patch)
2016-12-02 15:38 UTC, Debarshi Ray
committed Details | Review

Description Debarshi Ray 2016-12-02 15:32:17 UTC
According to the documentation, gtk_flow_box_get_child_at_index should return NULL when the given index is invalid. Instead, it crashes.

Here is the equivalent fix for GtkListBox:

commit abf10a74b7e2f1b36dcd2896be299508226cce42
Author: Paolo Borelli <pborelli@gnome.org>
Date:   Sun May 4 19:38:31 2014 +0200

    listbox: check gsequence end iter in get_row_at_index
Comment 1 Debarshi Ray 2016-12-02 15:38:36 UTC
Created attachment 341252 [details] [review]
flowbox: Fix get_child_at_index crash with an invalid index
Comment 2 Matthias Clasen 2016-12-02 16:36:59 UTC
Review of attachment 341252 [details] [review]:

sure. Please commit to gtk-3-22 as well
Comment 3 Debarshi Ray 2016-12-02 18:18:10 UTC
Comment on attachment 341252 [details] [review]
flowbox: Fix get_child_at_index crash with an invalid index

Pushed to both master and gtk-3-22. Thanks.