[epiphany] embed: Check for NULL SoupURI when trying to load invalid url



commit 8d9adfe3a05610e61ea8a96088c282b8244cb385
Author: Carlos Garnacho <carlosg gnome org>
Date:   Thu Jun 30 16:45:13 2016 +0200

    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 files changed, 3 insertions(+), 2 deletions(-)
---
diff --git a/embed/ephy-web-view.c b/embed/ephy-web-view.c
index c31857c..d7135a1 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


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]