From: John Darrington Date: Sat, 25 Feb 2012 11:15:03 +0000 (+0100) Subject: ascii.c (ascii_reserve) Added assertion. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=94a8e93c4397e1140dd6de5db19d054df546419e;p=pspp ascii.c (ascii_reserve) Added assertion. Added this assertion to catch a yet-to-be fixed array bounds bug. --- diff --git a/src/output/ascii.c b/src/output/ascii.c index 1c3e6b8238..7804ade3f4 100644 --- a/src/output/ascii.c +++ b/src/output/ascii.c @@ -749,7 +749,9 @@ find_ascii_pos (struct ascii_line *line, int target_x, struct ascii_pos *c) static char * ascii_reserve (struct ascii_driver *a, int y, int x0, int x1, int n) { - struct ascii_line *line = &a->lines[y]; + struct ascii_line *line; + assert (y < a->allocated_lines); + line = &a->lines[y]; if (x0 >= line->width) {