From 94a8e93c4397e1140dd6de5db19d054df546419e Mon Sep 17 00:00:00 2001 From: John Darrington Date: Sat, 25 Feb 2012 12:15:03 +0100 Subject: [PATCH] ascii.c (ascii_reserve) Added assertion. Added this assertion to catch a yet-to-be fixed array bounds bug. --- src/output/ascii.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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) { -- 2.30.2