forked from len0rd/rockbox
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
This commit is contained in:
parent
ae32e1ef06
commit
84fccff170
1 changed files with 3 additions and 3 deletions
|
|
@ -1660,9 +1660,9 @@ static int format_track_path(char *dest, char *src, int buf_length, int max,
|
||||||
char *temp_ptr;
|
char *temp_ptr;
|
||||||
|
|
||||||
/* Zero-terminate the file name */
|
/* Zero-terminate the file name */
|
||||||
while((src[i] != '\n') &&
|
while((i < max) &&
|
||||||
(src[i] != '\r') &&
|
(src[i] != '\n') &&
|
||||||
(i < max))
|
(src[i] != '\r'))
|
||||||
i++;
|
i++;
|
||||||
|
|
||||||
/* Now work back killing white space */
|
/* Now work back killing white space */
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue