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:
parent
6196925915
commit
3049a6bd04
1 changed files with 1 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue