Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
httpc: add more string url checking to http_client_simple_reconnect
  • Loading branch information
perexg committed Oct 17, 2015
1 parent 091c10d commit 4f557c7
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/httpc.c
Expand Up @@ -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 ||
Expand Down

0 comments on commit 4f557c7

Please sign in to comment.