]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
Don't crash if op == NULL, Ticket #334
authorAndreas Öman <andreas@lonelycoder.com>
Tue, 4 Jan 2011 20:43:34 +0000 (21:43 +0100)
committerAndreas Öman <andreas@lonelycoder.com>
Tue, 4 Jan 2011 20:43:34 +0000 (21:43 +0100)
src/webui/extjs.c

index 8eb3e36ac7c176114fd426bb378001430802cb1d..58b9cc819896cbebfb0a2e86d43e89080ef88540 100644 (file)
@@ -219,6 +219,9 @@ extjs_tablemgr(http_connection_t *hc, const char *remain, void *opaque)
   const char *op        = http_arg_get(&hc->hc_req_args, "op");
   const char *entries   = http_arg_get(&hc->hc_req_args, "entries");
 
+  if(op == NULL)
+    return 400;
+
   if(tablename == NULL || (dt = dtable_find(tablename)) == NULL)
     return 404;
   
@@ -356,6 +359,9 @@ extjs_channels(http_connection_t *hc, const char *remain, void *opaque)
   const char *op        = http_arg_get(&hc->hc_req_args, "op");
   const char *entries   = http_arg_get(&hc->hc_req_args, "entries");
 
+  if(op == NULL)
+    return 400;
+
   htsmsg_autodtor(in) =
     entries != NULL ? htsmsg_json_deserialize(entries) : NULL;
 
@@ -471,6 +477,9 @@ extjs_xmltv(http_connection_t *hc, const char *remain, void *opaque)
   htsmsg_t *out, *array, *e, *r;
   const char *s;
 
+  if(op == NULL)
+    return 400;
+
   pthread_mutex_lock(&global_lock);
 
   if(http_access_verify(hc, ACCESS_ADMIN)) {
@@ -1341,6 +1350,9 @@ extjs_iptvservices(http_connection_t *hc, const char *remain, void *opaque)
   service_t *t, **tvec;
   int count = 0, i = 0;
 
+  if(op == NULL)
+    return 400;
+
   pthread_mutex_lock(&global_lock);
 
   in = entries != NULL ? htsmsg_json_deserialize(entries) : NULL;