Diff between 42a5cd6237ea6d318aa1149390a2e0a6ebc755c1 and e97baaca22692ba78c82d699dd3057fa22e8eb2d

Changed Files

File Additions Deletions Status
profiles/audio/player.c +8 -0 modified

Full Patch

diff --git a/profiles/audio/player.c b/profiles/audio/player.c
index 3cfe679..de608a3 100644
--- a/profiles/audio/player.c
+++ b/profiles/audio/player.c
@@ -1013,6 +1013,14 @@ static DBusMessage *media_folder_change_folder(DBusConnection *conn,
 		return g_dbus_create_reply(msg, DBUS_TYPE_INVALID);
 	}
 
+	/*
+	 * ChangePath can only navigate one level up/down so check if folder
+	 * is direct child or parent of the current folder otherwise fail.
+	 */
+	if (!g_slist_find(mp->folder->subfolders, folder) &&
+				!g_slist_find(folder->subfolders, mp->folder))
+		return btd_error_invalid_args(msg);
+
 	if (cb->cbs->change_folder == NULL)
 		return btd_error_not_supported(msg);