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 /apps/gui/line.c | |
parent | 193911af760d460198fc7f08bf6da824f74975b7 (diff) | |
download | rockbox-09e655f89df9cea14838136a6072b0b2d8ee2d48.tar.gz rockbox-09e655f89df9cea14838136a6072b0b2d8ee2d48.zip |
put_line(): Add another check against possible buffer overflow (see 193911a).
Change-Id: Idc6637cc42afe612375dab3acac8495278f68f0a
Diffstat (limited to 'apps/gui/line.c')
-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, | |||
210 | tempbuf_idx = tempbuf[tempbuf_idx] = 0; | 210 | tempbuf_idx = tempbuf[tempbuf_idx] = 0; |
211 | put_text(display, xpos, y, line, tempbuf, false, 0); | 211 | put_text(display, xpos, y, line, tempbuf, false, 0); |
212 | xpos += display->getstringsize(tempbuf, NULL, NULL); | 212 | xpos += display->getstringsize(tempbuf, NULL, NULL); |
213 | if (xpos >= max_width) | ||
214 | return; | ||
213 | } | 215 | } |
214 | next: | 216 | next: |
215 | ch = *fmt++; | 217 | ch = *fmt++; |