]> 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:51:04 +0000 (08:51 +0100)
src/webui/webui_api.c

index 7bae1ea21781bf9a0471f8f2e1d0fa905bde6c5d..72d6d359a57a9b36ed977519d996d014ce3d802a 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 */