diff options
Diffstat (limited to 'libs/libcurl/src/idn.c')
-rw-r--r-- | libs/libcurl/src/idn.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/libs/libcurl/src/idn.c b/libs/libcurl/src/idn.c index b7c0a18b85..47b4d4655d 100644 --- a/libs/libcurl/src/idn.c +++ b/libs/libcurl/src/idn.c @@ -184,6 +184,11 @@ CURLcode Curl_idnconvert_hostname(struct hostname *host) if(!Curl_is_ASCII_name(host->name)) {
char *decoded = idn_decode(host->name);
if(decoded) {
+ if(!*decoded) {
+ /* zero length is a bad host name */
+ Curl_idn_free(decoded);
+ return CURLE_URL_MALFORMAT;
+ }
/* successful */
host->encalloc = decoded;
/* change the name pointer to point to the encoded hostname */
|