put_line(): Add another check against possible buffer overflow (see 193911a).

Change-Id: Idc6637cc42afe612375dab3acac8495278f68f0a
This commit is contained in:
Thomas Martitz 2014-01-12 19:19:05 +01:00
parent 193911af76
commit 09e655f89d

View file

@ -210,6 +210,8 @@ static void print_line(struct screen *display,
tempbuf_idx = tempbuf[tempbuf_idx] = 0;
put_text(display, xpos, y, line, tempbuf, false, 0);
xpos += display->getstringsize(tempbuf, NULL, NULL);
if (xpos >= max_width)
return;
}
next:
ch = *fmt++;