From 09f9b5f9865aa7e58dd912a4ac0f328b5de48ad4 Mon Sep 17 00:00:00 2001 From: Carlos Garcia Campos Date: Thu, 28 Mar 2013 16:16:02 +0100 Subject: 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 --- lib/widgets/ephy-location-entry.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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, -- cgit v1.2.3