mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2025-01-17 23:50:16 +00:00
treestore: Fix segfault when reordering non-existing children
Calling gtk_tree_store_reorder() on a node without children would cause a segfault; Fixes https://bugzilla.gnome.org/show_bug.cgi?id=698396 Signed-off-by: Olivier Brunel <jjk@jjacky.com>
This commit is contained in:
parent
75c22332d0
commit
0d2d1904b1
@ -2280,6 +2280,12 @@ gtk_tree_store_reorder (GtkTreeStore *tree_store,
|
||||
else
|
||||
level = G_NODE (parent->user_data)->children;
|
||||
|
||||
if (G_UNLIKELY (!level))
|
||||
{
|
||||
g_warning ("%s: Cannot reorder, parent has no children", G_STRLOC);
|
||||
return;
|
||||
}
|
||||
|
||||
/* count nodes */
|
||||
node = level;
|
||||
while (node)
|
||||
|
Loading…
Reference in New Issue
Block a user