From 920cb0571d93f956385e193389dd1f564efc5304 Mon Sep 17 00:00:00 2001 From: Chris Young Date: Fri, 17 Jul 2015 20:44:52 +0100 Subject: Check we've obtained the host string --- utils/nsurl.c | 5 +++++ 1 file changed, 5 insertions(+) (limited to 'utils') diff --git a/utils/nsurl.c b/utils/nsurl.c index 6a9296022..6675ee1a7 100644 --- a/utils/nsurl.c +++ b/utils/nsurl.c @@ -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); -- cgit v1.2.3