From 84fccff17070ba78764ae200c4f38e0a53ff0ce7 Mon Sep 17 00:00:00 2001 From: Thomas Jarosch Date: Fri, 18 Feb 2011 21:21:50 +0000 Subject: 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 --- apps/playlist.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'apps') 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 */ -- cgit v1.2.3