diff options
author | Thomas Martitz <kugel@rockbox.org> | 2014-01-12 19:19:05 +0100 |
---|---|---|
committer | Thomas Martitz <kugel@rockbox.org> | 2014-01-12 19:19:05 +0100 |
commit | 09e655f89df9cea14838136a6072b0b2d8ee2d48 (patch) | |
tree | 18a1860e902b648f076922dc5c6bbafb897299b0 | |
parent | 193911af760d460198fc7f08bf6da824f74975b7 (diff) | |
download | rockbox-09e655f.tar.gz rockbox-09e655f.zip |
put_line(): Add another check against possible buffer overflow (see 193911a).
Change-Id: Idc6637cc42afe612375dab3acac8495278f68f0a
-rw-r--r-- | apps/gui/line.c | 2 |
1 files changed, 2 insertions, 0 deletions
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++; |