1
0
Fork 0
forked from len0rd/rockbox

Database: Fixed a potential buffer overrun in format_str. From

FS#12132 patch 8.

git-svn-id: svn://svn.rockbox.org/rockbox/branches/v3_9@30252 a1c6a512-1295-4272-9138-f99709370657
This commit is contained in:
Michael Hohmuth 2011-08-04 12:13:16 +00:00
parent 6196925915
commit 3049a6bd04

View file

@ -1129,7 +1129,7 @@ static int format_str(struct tagcache_search *tcs, struct display_format *fmt,
buf[buf_pos++] = fmt->formatstr[i];
if (buf_pos - 1 >= buf_size)
if (buf_pos >= buf_size - 1) /* need at least one more byte for \0 */
{
logf("buffer overflow");
return -4;