From 9fff8d12468458dc467d5f67ff7cd3bd5372df41 Mon Sep 17 00:00:00 2001 From: Jon Trowbridge Date: Sat, 15 Sep 2001 06:57:00 +0000 Subject: Check that unsorted >= 0 before using it as an array index. (Bug #9115) 2001-09-15 Jon Trowbridge * gal/widgets/e-reflow.c (e_reflow_reflow): Check that unsorted >= 0 before using it as an array index. (Bug #9115) svn path=/trunk/; revision=12852 --- widgets/misc/e-reflow.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'widgets/misc') diff --git a/widgets/misc/e-reflow.c b/widgets/misc/e-reflow.c index ad414fd65e..bbb29b88e8 100644 --- a/widgets/misc/e-reflow.c +++ b/widgets/misc/e-reflow.c @@ -1102,11 +1102,12 @@ e_reflow_reflow( GnomeCanvasItem *item, int flags ) next_column ++; } - if (reflow->items[unsorted]) + if (unsorted >= 0 && reflow->items[unsorted]) { e_canvas_item_move_absolute(GNOME_CANVAS_ITEM(reflow->items[unsorted]), (double) running_width, (double) running_height); - running_height += reflow->heights[unsorted] + E_REFLOW_BORDER_WIDTH; + running_height += reflow->heights[unsorted] + E_REFLOW_BORDER_WIDTH; + } } reflow->width = running_width + reflow->column_width + E_REFLOW_BORDER_WIDTH; if ( reflow->width < reflow->minimum_width ) -- cgit