From 9573c6efe61fe91b055e66ee7928bfe0e2b3bc0a Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Thu, 30 Jun 2016 16:45:13 +0200 Subject: embed: Check for NULL SoupURI when trying to load invalid url Fixes crashes when accessing soup_uri memory. If there is no valid uri, just set the "local page" security level. https://bugzilla.gnome.org/show_bug.cgi?id=768250 --- embed/ephy-web-view.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c index 73166bc..40af96a 100644 --- a/embed/ephy-web-view.c +++ b/embed/ephy-web-view.c @@ -1427,7 +1427,7 @@ update_security_status_for_committed_load (EphyWebView *view, g_clear_object (&view->certificate); g_clear_pointer (&view->tls_error_failing_uri, g_free); - if (webkit_security_manager_uri_scheme_is_local (security_manager, soup_uri->scheme)) { + if (!soup_uri || webkit_security_manager_uri_scheme_is_local (security_manager, soup_uri->scheme)) { security_level = EPHY_SECURITY_LEVEL_LOCAL_PAGE; } else if (webkit_web_view_get_tls_info (WEBKIT_WEB_VIEW (view), &view->certificate, &view->tls_errors)) { g_object_ref (view->certificate); @@ -1439,7 +1439,8 @@ update_security_status_for_committed_load (EphyWebView *view, ephy_web_view_set_security_level (view, security_level); - soup_uri_free (soup_uri); + if (soup_uri) + soup_uri_free (soup_uri); } static void -- cgit v0.12