Fix for http client URL does not contain slash cause crash issue
@@ -133,6 +133,10 @@ static int httpclient_parse_url(const char *url, char *scheme, size_t max_scheme
*port = 0;
}
path_ptr = strchr(host_ptr, '/');
+ if (path_ptr == NULL) {
+ http_err("URL fail to find slash, eg. http://localhost:8080");
+ return HTTP_EPARSE;
+ }
if ( host_len == 0 ) {
host_len = path_ptr - host_ptr;
}
