1
0
Fork 0
forked from len0rd/rockbox

playlist: Fix out-of-bounds array access when the directory is blank

Change-Id: Ibf59f8191f1f26cf97c5d3ffcb5e3e4c7304bca0
This commit is contained in:
Solomon Peachy 2020-12-13 19:20:38 -05:00
parent ce7731527a
commit b6a16949e8

View file

@ -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++;