diff --git a/core/net/http-socket/http-socket.c b/core/net/http-socket/http-socket.c index 1e5ebbb27..ddcebaec1 100644 --- a/core/net/http-socket/http-socket.c +++ b/core/net/http-socket/http-socket.c @@ -349,6 +349,11 @@ parse_url(const char *url, char *host, uint16_t *portptr, char *path) } } + /* check if host is null terminated */ + if (!memchr(host, 0, MAX_HOSTLEN)) { + return 0; + } + /* Find the port. Default is 80. */ port = 80; if(*urlptr == ':') {