From 4472f9e9558bc3baf730d1fdd924cb7fac6552a6 Mon Sep 17 00:00:00 2001 From: Julien BLACHE Date: Mon, 15 Aug 2011 12:50:43 +0200 Subject: [PATCH] Fix infinite loop on unknown DACP property Missing strtok_r() call in the !dpm case. --- src/httpd_dacp.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/httpd_dacp.c b/src/httpd_dacp.c index 219c7a34..5486badb 100644 --- a/src/httpd_dacp.c +++ b/src/httpd_dacp.c @@ -1260,16 +1260,15 @@ dacp_reply_getproperty(struct evhttp_request *req, struct evbuffer *evbuf, char while (prop) { dpm = dacp_find_prop(prop, strlen(prop)); - if (!dpm) + if (dpm) { - DPRINTF(E_LOG, L_DACP, "Could not find requested property '%s'\n", prop); - continue; + if (dpm->propget) + dpm->propget(proplist, &status, mfi); + else + DPRINTF(E_WARN, L_DACP, "No getter method for DACP property %s\n", prop); } - - if (dpm->propget) - dpm->propget(proplist, &status, mfi); else - DPRINTF(E_WARN, L_DACP, "No getter method for DACP property %s\n", prop); + DPRINTF(E_LOG, L_DACP, "Could not find requested property '%s'\n", prop); prop = strtok_r(NULL, ",", &ptr); }