diff options
author | Carlos Garcia Campos <cgarcia@igalia.com> | 2013-03-28 23:16:02 +0800 |
---|---|---|
committer | Carlos Garcia Campos <carlosgc@gnome.org> | 2013-03-30 19:08:27 +0800 |
commit | 09f9b5f9865aa7e58dd912a4ac0f328b5de48ad4 (patch) | |
tree | d7428eb1df1dc6fa491abcd43af5f7fba3b82903 | |
parent | 627800228d6d745a231707d707f5f7bda9403059 (diff) | |
download | gsoc2013-epiphany-09f9b5f9865aa7e58dd912a4ac0f328b5de48ad4.tar gsoc2013-epiphany-09f9b5f9865aa7e58dd912a4ac0f328b5de48ad4.tar.gz gsoc2013-epiphany-09f9b5f9865aa7e58dd912a4ac0f328b5de48ad4.tar.bz2 gsoc2013-epiphany-09f9b5f9865aa7e58dd912a4ac0f328b5de48ad4.tar.lz gsoc2013-epiphany-09f9b5f9865aa7e58dd912a4ac0f328b5de48ad4.tar.xz gsoc2013-epiphany-09f9b5f9865aa7e58dd912a4ac0f328b5de48ad4.tar.zst gsoc2013-epiphany-09f9b5f9865aa7e58dd912a4ac0f328b5de48ad4.zip |
Do not schedule a DNS prefetch for invalid URIs or without a hostname
It produces a runtime critical warning when trying to use
webkit_web_context_prefetch_dns() with a NULL hostname.
https://bugzilla.gnome.org/show_bug.cgi?id=696787
-rw-r--r-- | lib/widgets/ephy-location-entry.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/lib/widgets/ephy-location-entry.c b/lib/widgets/ephy-location-entry.c index b21f65696..bb5300e61 100644 --- a/lib/widgets/ephy-location-entry.c +++ b/lib/widgets/ephy-location-entry.c @@ -966,13 +966,20 @@ static void schedule_dns_prefetch (EphyLocationEntry *entry, guint interval, const gchar *url) { PrefetchHelper *helper; + SoupURI *uri; + + uri = soup_uri_new (url); + if (!uri || !uri->host) { + soup_uri_free (uri); + return; + } if (entry->priv->dns_prefetch_handler) g_source_remove (entry->priv->dns_prefetch_handler); helper = g_slice_new0 (PrefetchHelper); helper->entry = g_object_ref (entry); - helper->uri = soup_uri_new (url); + helper->uri = uri; entry->priv->dns_prefetch_handler = g_timeout_add_full (G_PRIORITY_DEFAULT, interval, |