From 80b183c7ffe0c09be2ed8626e105fc668b8e9230 Mon Sep 17 00:00:00 2001 From: ejurgensen Date: Mon, 30 Dec 2019 21:54:00 +0100 Subject: [PATCH] [dacp] Fix for genres that have single quotes in their name (fixes #869) --- src/httpd_dacp.c | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/httpd_dacp.c b/src/httpd_dacp.c index 251a2e5b..626237e7 100644 --- a/src/httpd_dacp.c +++ b/src/httpd_dacp.c @@ -373,14 +373,14 @@ dacp_queueitem_add(const char *query, const char *queuefilter, const char *sort, else if ((len > 6) && (strncmp(queuefilter, "genre:", 6) == 0)) { qp.type = Q_ITEMS; - ret = db_snprintf(buf, sizeof(buf), "f.genre = %Q", queuefilter + 6); - if (ret < 0) + ret = snprintf(buf, sizeof(buf), "'daap.song%s'", queuefilter); + if (ret < 0 || ret >= sizeof(buf)) { - DPRINTF(E_LOG, L_DACP, "Invalid genre in queuefilter: '%s'\n", queuefilter); + DPRINTF(E_LOG, L_DACP, "Invalid genre length in queuefilter: '%s'\n", queuefilter); return -1; } - qp.filter = strdup(buf); + qp.filter = daap_query_parse_sql(buf); } else {