]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
httpc: add more string url checking to http_client_simple_reconnect
authorJaroslav Kysela <perex@perex.cz>
Sat, 17 Oct 2015 19:39:31 +0000 (21:39 +0200)
committerJaroslav Kysela <perex@perex.cz>
Sat, 17 Oct 2015 19:39:31 +0000 (21:39 +0200)
src/httpc.c

index 56d2b8dbd8659eec5940757956e63ff94e36e949..d524332f3c7f5ccaa9d719209bbe1b99be291b5b 100644 (file)
@@ -1147,6 +1147,12 @@ http_client_simple_reconnect ( http_client_t *hc, const url_t *u )
   tvhpoll_t *efd;
   int r;
 
+  if (u->scheme == NULL || u->scheme[0] == '\0' ||
+      u->host == NULL || u->host[0] == '\0' ||
+      u->port <= 0) {
+    tvherror("httpc", "Invalid url '%s'", u->raw);
+    return -EINVAL;
+  }
   if (strcmp(u->scheme, hc->hc_scheme) ||
       strcmp(u->host, hc->hc_host) ||
       http_port(hc, u->scheme, u->port) != hc->hc_port ||