From 0e0fbd006f2050ef9a13dad1e46ca34ecbe0f7c1 Mon Sep 17 00:00:00 2001 From: chme Date: Sun, 1 Nov 2015 12:47:04 +0100 Subject: [PATCH] [queue] fix segfault if query for queue-items returned an empty result set This happen for example if a wrong path is passed in "mpc add [virtual_path]" --- src/queue.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/queue.c b/src/queue.c index 86e07c53..688e3098 100644 --- a/src/queue.c +++ b/src/queue.c @@ -1187,6 +1187,12 @@ queueitem_make_byquery(struct query_params *qp) return NULL; } + if (!item_head || !item_tail) + { + DPRINTF(E_INFO, L_PLAYER, "No item found to add to queue\n"); + return NULL; + } + item_head->prev = item_tail; item_tail->next = item_head; item_head->shuffle_prev = item_tail;