diff options
author | Thomas Jarosch <tomj@simonv.com> | 2011-02-18 21:21:50 +0000 |
---|---|---|
committer | Thomas Jarosch <tomj@simonv.com> | 2011-02-18 21:21:50 +0000 |
commit | 84fccff17070ba78764ae200c4f38e0a53ff0ce7 (patch) | |
tree | 1569ec290b455f3e93dde9e652b4ff94df3e2224 /apps | |
parent | ae32e1ef06b57e71e7130ce76082cb0877aaaca5 (diff) |
Fix off-by-one buffer read access in format_track_path(). Part of #11947
We need to check for "i < max" first.
git-svn-id: svn://svn.rockbox.org/rockbox/trunk@29324 a1c6a512-1295-4272-9138-f99709370657
Diffstat (limited to 'apps')
-rw-r--r-- | apps/playlist.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/apps/playlist.c b/apps/playlist.c index 6f6db27b2a..3bbe8b2f99 100644 --- a/apps/playlist.c +++ b/apps/playlist.c @@ -1660,9 +1660,9 @@ static int format_track_path(char *dest, char *src, int buf_length, int max, char *temp_ptr; /* Zero-terminate the file name */ - while((src[i] != '\n') && - (src[i] != '\r') && - (i < max)) + while((i < max) && + (src[i] != '\n') && + (src[i] != '\r')) i++; /* Now work back killing white space */ |