From 5e4d40ee03ae22ab79534bb1410fa9db96c9fabd Mon Sep 17 00:00:00 2001 From: ejurgensen Date: Thu, 24 Jul 2025 18:08:10 +0200 Subject: [PATCH] [dacp] Fix null dereference on missing mode param Fixes #1907 --- src/httpd_dacp.c | 9 +++++---- 1 file changed, 5 insertions(+), 4 deletions(-) diff --git a/src/httpd_dacp.c b/src/httpd_dacp.c index ef8ba943..5349e2c1 100644 --- a/src/httpd_dacp.c +++ b/src/httpd_dacp.c @@ -1852,15 +1852,16 @@ dacp_reply_playqueueedit_clear(struct httpd_request *hreq) const char *param; struct player_status status; - param = httpd_query_value_find(hreq->query, "mode"); - /* * The mode parameter contains the playlist to be cleared. * If mode=0x68697374 (hex representation of the ascii string "hist") clear the history, * otherwise the current playlist. */ - if (strcmp(param,"0x68697374") == 0) - player_queue_clear_history(); + param = httpd_query_value_find(hreq->query, "mode"); + if (param && strcmp(param,"0x68697374") == 0) + { + player_queue_clear_history(); + } else { player_get_status(&status);