]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
api: return an error when incomplete query is passed, fixes #5568
authorJaroslav Kysela <perex@perex.cz>
Thu, 21 Mar 2019 07:49:34 +0000 (08:49 +0100)
committerJaroslav Kysela <perex@perex.cz>
Thu, 21 Mar 2019 07:50:34 +0000 (08:50 +0100)
src/webui/webui_api.c

index 895214431f34c10025ac4ec89de25ee711835902..673d81643ecc867d482906924b3032a17ff3208b 100644 (file)
@@ -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 */