mirror of
https://github.com/curl/curl.git
synced 2025-01-24 14:15:18 +08:00
url: reject URLs with hostnames longer than 65535 bytes
It *probably* causes other problems too since DNS can't resolve such long names, but the SNI field in TLS is limited to 16 bits length. Closes #9317
This commit is contained in:
parent
20d083572a
commit
657101ec0c
@ -2025,6 +2025,10 @@ static CURLcode parseurlandfillconn(struct Curl_easy *data,
|
||||
if(!strcasecompare("file", data->state.up.scheme))
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
else if(strlen(data->state.up.hostname) > 0xffff) {
|
||||
failf(data, "Too long host name");
|
||||
return CURLE_URL_MALFORMAT;
|
||||
}
|
||||
|
||||
#ifndef CURL_DISABLE_HSTS
|
||||
if(data->hsts && strcasecompare("http", data->state.up.scheme)) {
|
||||
|
Loading…
Reference in New Issue
Block a user