mirror of
https://github.com/curl/curl.git
synced 2026-05-14 17:26:19 +03: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
1 changed files with 4 additions and 0 deletions
|
|
@ -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…
Add table
Add a link
Reference in a new issue