From: John Darrington Date: Sun, 7 Dec 2008 02:31:05 +0000 (+0900) Subject: Trap some bad usage X-Git-Tag: v0.7.1~60 X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=aae795eeb6eadf1381f4578b22d04001e501d32c;p=pspp-builds.git Trap some bad usage --- diff --git a/lib/gtksheet/psppire-axis-impl.c b/lib/gtksheet/psppire-axis-impl.c index be47d874..b722a87b 100644 --- a/lib/gtksheet/psppire-axis-impl.c +++ b/lib/gtksheet/psppire-axis-impl.c @@ -313,7 +313,12 @@ void psppire_axis_impl_insert (PsppireAxisImpl *a, gint posn, gint size) { struct axis_node *before = NULL; - struct axis_node *new_node = pool_alloc (a->pool, sizeof (*new_node)); + struct axis_node *new_node; + + g_return_if_fail ( posn < tower_height (&a->unit_tower)); + g_return_if_fail ( posn >= 0); + + new_node = pool_alloc (a->pool, sizeof (*new_node)); if ( posn > 0) {