mirror of
https://github.com/curl/curl.git
synced 2026-08-24 16:13:43 +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;
|
result = CURLE_OUT_OF_MEMORY;
|
||||||
}
|
}
|
||||||
#endif
|
#endif
|
||||||
if(!result)
|
if(!result) {
|
||||||
*output = d;
|
if(!d[0]) /* ended up zero length, not acceptable */
|
||||||
|
result = CURLE_URL_MALFORMAT;
|
||||||
|
else
|
||||||
|
*output = d;
|
||||||
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue