m3u playlist parser: Check size limit before using buffer
This should only be a problem if the last line is not terminated by \r or \n though. cppcheck reported: [rockbox/apps/playlist.c:234]: (style) Array index 'i' is used before limits check. Change-Id: I8182b66272ba9c024984c81588bd2a6dbb8255b8
This commit is contained in:
parent
2caf8870af
commit
f8d9e9cb6c
1 changed files with 1 additions and 1 deletions
|
@ -231,7 +231,7 @@ static int convert_m3u(char* buf, int buf_len, int buf_max, char* temp)
|
|||
char* dest;
|
||||
|
||||
/* Locate EOL. */
|
||||
while ((buf[i] != '\n') && (buf[i] != '\r') && (i < buf_len))
|
||||
while ((i < buf_len) && (buf[i] != '\n') && (buf[i] != '\r'))
|
||||
{
|
||||
i++;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue