From: Jaroslav Kysela Date: Sat, 17 Oct 2015 19:39:31 +0000 (+0200) Subject: httpc: add more string url checking to http_client_simple_reconnect X-Git-Tag: v4.2.1~1884 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=4f557c7869b0676d395be6af4e7d42f2b52de330;p=thirdparty%2Ftvheadend.git httpc: add more string url checking to http_client_simple_reconnect --- diff --git a/src/httpc.c b/src/httpc.c index 56d2b8dbd..d524332f3 100644 --- a/src/httpc.c +++ b/src/httpc.c @@ -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 ||