From 9f9ec7da570bf1468eafe611023627c9a2b0b5d2 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Mon, 13 May 2019 18:42:05 +0200 Subject: urlapi: require a non-zero host name length when parsing URL Updated test 1560 to verify. Closes #3880 --- lib/urlapi.c | 2 ++ 1 file changed, 2 insertions(+) (limited to 'lib') diff --git a/lib/urlapi.c b/lib/urlapi.c index c66c07f0a..0d05f4d92 100644 --- a/lib/urlapi.c +++ b/lib/urlapi.c @@ -636,6 +636,8 @@ static CURLUcode hostname_check(struct Curl_URL *u, char *hostname) /* hostname with bad content */ return CURLUE_MALFORMED_INPUT; } + if(!hostname[0]) + return CURLUE_NO_HOST; return CURLUE_OK; } -- cgit v1.2.3