summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorSolomon Peachy <pizza@shaftnet.org>2020-12-13 19:20:38 -0500
committerSolomon Peachy <pizza@shaftnet.org>2020-12-13 19:20:38 -0500
commitb6a16949e88dbff5d13fdbaa2cd72ef25e10696a (patch)
tree754b348a395f3d71f5c3796eaa680280615bc92b
parentce7731527ab71d789a8113ac6d136315b67cd013 (diff)
downloadrockbox-b6a16949e88dbff5d13fdbaa2cd72ef25e10696a.tar.gz
rockbox-b6a16949e88dbff5d13fdbaa2cd72ef25e10696a.tar.bz2
rockbox-b6a16949e88dbff5d13fdbaa2cd72ef25e10696a.zip
playlist: Fix out-of-bounds array access when the directory is blank
Change-Id: Ibf59f8191f1f26cf97c5d3ffcb5e3e4c7304bca0
-rw-r--r--apps/playlist.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/apps/playlist.c b/apps/playlist.c
index 34a3ea53d2..2b94a13bca 100644
--- a/apps/playlist.c
+++ b/apps/playlist.c
@@ -524,7 +524,7 @@ static void update_playlist_filename(struct playlist_info* playlist,
/* If the dir does not end in trailing slash, we use a separator.
Otherwise we don't. */
- if('/' != dir[dirlen-1])
+ if(!dirlen || '/' != dir[dirlen-1])
{
sep="/";
dirlen++;