From 09e655f89df9cea14838136a6072b0b2d8ee2d48 Mon Sep 17 00:00:00 2001 From: Thomas Martitz Date: Sun, 12 Jan 2014 19:19:05 +0100 Subject: put_line(): Add another check against possible buffer overflow (see 193911a). Change-Id: Idc6637cc42afe612375dab3acac8495278f68f0a --- apps/gui/line.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'apps/gui/line.c') diff --git a/apps/gui/line.c b/apps/gui/line.c index 5e22d6da26..4d08a34372 100644 --- a/apps/gui/line.c +++ b/apps/gui/line.c @@ -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++; -- cgit v1.2.3