diff options
| author | Thomas Jarosch <tomj@simonv.com> | 2014-12-20 13:09:22 +0100 |
|---|---|---|
| committer | Thomas Jarosch <tomj@simonv.com> | 2014-12-20 13:14:19 +0100 |
| commit | f8d9e9cb6c4cbec8a611f871de006608ad7a1dbd (patch) | |
| tree | 07b8e7b97c81470c710fd408603f688c8946beab /apps | |
| parent | 2caf8870afd844c1368d21b98b3d1e4c0ee8bf10 (diff) | |
| download | rockbox-f8d9e9cb6c4cbec8a611f871de006608ad7a1dbd.zip rockbox-f8d9e9cb6c4cbec8a611f871de006608ad7a1dbd.tar.gz rockbox-f8d9e9cb6c4cbec8a611f871de006608ad7a1dbd.tar.bz2 rockbox-f8d9e9cb6c4cbec8a611f871de006608ad7a1dbd.tar.xz | |
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
Diffstat (limited to 'apps')
| -rw-r--r-- | apps/playlist.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/playlist.c b/apps/playlist.c index db93344..173d445 100644 --- a/apps/playlist.c +++ b/apps/playlist.c @@ -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++; } |