Skip to content

Commit

Permalink
Fix infinite loop on unknown DACP property
Browse files Browse the repository at this point in the history
Missing strtok_r() call in the !dpm case.
  • Loading branch information
jblache committed Aug 15, 2011
1 parent 177d444 commit 4472f9e
Showing 1 changed file with 6 additions and 7 deletions.
13 changes: 6 additions & 7 deletions src/httpd_dacp.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 4472f9e

Please sign in to comment.