diff options
Diffstat (limited to 'Utilities/cmcurl/lib/idn.c')
-rw-r--r-- | Utilities/cmcurl/lib/idn.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/Utilities/cmcurl/lib/idn.c b/Utilities/cmcurl/lib/idn.c index abba895c45..5f4b07e018 100644 --- a/Utilities/cmcurl/lib/idn.c +++ b/Utilities/cmcurl/lib/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 */ |