From 1d1e41916a847bffa2879ad645d3b42038d5ffd0 Mon Sep 17 00:00:00 2001 From: Anna Schumaker Date: Thu, 28 Jul 2016 08:55:53 -0400 Subject: [PATCH] core/playlists/system: Check that we read a valid playlist name Otherwise we could crash when we try to access an out of bounds area of the playlist array. Signed-off-by: Anna Schumaker --- core/playlists/system.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/core/playlists/system.c b/core/playlists/system.c index a5dd4f66..fe6a9fa7 100644 --- a/core/playlists/system.c +++ b/core/playlists/system.c @@ -53,7 +53,8 @@ static bool __sys_pl_load() file_readf(&sys_file, "%*u %m[^\n]\n", &name); plist = __sys_pl_convert(name); - queue_load_tracks(&sys_playlists[plist], &sys_file); + if (plist < SYS_PL_NUM_PLAYLISTS) + queue_load_tracks(&sys_playlists[plist], &sys_file); g_free(name); }