[epiphany/gnome-3-26] session: Fix crash when JS opens an invalid URI



commit 56a254bf4e3eaef3ae7ca4ea0dc9a6d62d3a2278
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Tue May 22 21:06:32 2018 -0500

    session: Fix crash when JS opens an invalid URI
    
    https://bugzilla.gnome.org/show_bug.cgi?id=795740

 src/ephy-session.c |    9 ++++++++-
 1 files changed, 8 insertions(+), 1 deletions(-)
---
diff --git a/src/ephy-session.c b/src/ephy-session.c
index ba6ef70..ff6456a 100644
--- a/src/ephy-session.c
+++ b/src/ephy-session.c
@@ -828,8 +828,15 @@ session_seems_sane (GList *windows)
       SoupURI *uri;
       gboolean sane = FALSE;
 
+      /* NULL URLs are possible when an invalid URL is opened by JS.
+       * E.g. <script>win = window.open("blah", "WIN");</script>
+       */
+      if (url == NULL)
+        continue;
+
       /* Blank URLs can occur in some situations. Just ignore these, as they
-       * are harmless and not an indicator of a corrupted session. */
+       * are harmless and not an indicator of a corrupted session.
+       */
       if (strcmp (url, "") == 0)
         continue;
 


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