mirror of
https://github.com/curl/curl.git
synced 2026-04-15 01:31:41 +03:00
idn: reject conversions that end up as a zero length hostname
Reported-by: RepoRascal on hackerone Closes #18462
This commit is contained in:
parent
8603d5262b
commit
967a626af4
1 changed files with 6 additions and 2 deletions
|
|
@ -323,8 +323,12 @@ CURLcode Curl_idn_decode(const char *input, char **output)
|
|||
result = CURLE_OUT_OF_MEMORY;
|
||||
}
|
||||
#endif
|
||||
if(!result)
|
||||
*output = d;
|
||||
if(!result) {
|
||||
if(!d[0]) /* ended up zero length, not acceptable */
|
||||
result = CURLE_URL_MALFORMAT;
|
||||
else
|
||||
*output = d;
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue