Check we've obtained the host string

This commit is contained in:
Chris Young 2015-07-17 20:44:52 +01:00
parent 6afda499c2
commit 920cb0571d
1 changed files with 5 additions and 0 deletions

View File

@ -1713,6 +1713,11 @@ char *nsurl_access_utf8(const nsurl *url)
assert(url != NULL);
host = nsurl_get_component(url, NSURL_HOST);
if(host == NULL) {
return strdup(url->string);
}
if (idna_decode(lwc_string_data(host), lwc_string_length(host),
&idna_host, &idna_host_len) != NSERROR_OK) {
lwc_string_unref(host);