From: Jaroslav Kysela Date: Thu, 21 Mar 2019 07:49:34 +0000 (+0100) Subject: api: return an error when incomplete query is passed, fixes #5568 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=14d22c3797f2077bc31dfdd03cd1cc5e94511b00;p=thirdparty%2Ftvheadend.git api: return an error when incomplete query is passed, fixes #5568 --- diff --git a/src/webui/webui_api.c b/src/webui/webui_api.c index 7bae1ea21..72d6d359a 100644 --- a/src/webui/webui_api.c +++ b/src/webui/webui_api.c @@ -36,11 +36,17 @@ webui_api_handler /* Build arguments */ args = htsmsg_create_map(); TAILQ_FOREACH(ha, &hc->hc_req_args, link) { + if (ha->val == NULL) { + r = EINVAL; + goto destroy_args; + } htsmsg_add_str(args, ha->key, ha->val); } /* Call */ r = api_exec(hc->hc_access, remain, args, &resp); + +destroy_args: htsmsg_destroy(args); /* Convert error */