From b6a16949e88dbff5d13fdbaa2cd72ef25e10696a Mon Sep 17 00:00:00 2001 From: Solomon Peachy Date: Sun, 13 Dec 2020 19:20:38 -0500 Subject: playlist: Fix out-of-bounds array access when the directory is blank Change-Id: Ibf59f8191f1f26cf97c5d3ffcb5e3e4c7304bca0 --- apps/playlist.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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++; -- cgit