GNOME Bugzilla – Bug 633915
gtk_button_box_child_requisition() mishandles size allocations
Last modified: 2010-11-04 03:01:59 UTC
The function counts the number of visible children and tries to allocate returned widths and heights based on that count. But if the # of visible children is 0, the g_new() call return NULL because it was asked to allocate no memory, and callers of gtk_button_box_child_requisition() like gtk_button_box_size_allocate() which try to use the returned allocated arrays crash. while (children) { ... if (gtk_widget_get_visible (child)) { nchildren += 1; ... } } *widths = g_new (gint, nchildren); *heights = g_new (gint, nchildren); etc, *widths and *heights will be NULL on return which doesn't work so well :(