[epiphany/gnome-3-14] Fix crash when receiving a NULL string from DOM bindings



commit 9a2f66e3c3e40c39112b3278f3071852908dc6bf
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Fri Feb 27 13:07:43 2015 -0600

    Fix crash when receiving a NULL string from DOM bindings
    
    As of WebKitGTK+ 2.6.5: "Object DOM bindings API now correctly returns
    NULL intead of empty strings to be able to differentiate between not
    present and present but empty."
    
    This was causing crashes on e.g.
    http://www.publico.pt/local/noticia/sindicato-anuncia-adiamento-de-greve-no-metro-de-lisboa-1687386
    
    https://bugzilla.gnome.org/show_bug.cgi?id=745306

 lib/ephy-web-dom-utils.c |    6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)
---
diff --git a/lib/ephy-web-dom-utils.c b/lib/ephy-web-dom-utils.c
index 72df883..75c586c 100644
--- a/lib/ephy-web-dom-utils.c
+++ b/lib/ephy-web-dom-utils.c
@@ -375,7 +375,7 @@ ephy_web_dom_utils_find_form_auth_elements (WebKitDOMHTMLFormElement *form,
 
     g_object_get (element, "type", &element_type, "name", &element_name, NULL);
 
-    if (g_str_equal (element_type, "text") || g_str_equal (element_type, "email")) {
+    if (g_strcmp0 (element_type, "text") == 0 || g_strcmp0 (element_type, "email") == 0) {
       /* We found more than one inputs of type text; we won't be saving here. */
       if (username_node) {
         g_free (element_type);
@@ -385,7 +385,7 @@ ephy_web_dom_utils_find_form_auth_elements (WebKitDOMHTMLFormElement *form,
 
       username_node = g_object_ref (element);
       found_auth_elements = TRUE;
-    } else if (g_str_equal (element_type, "password")) {
+    } else if (g_strcmp0 (element_type, "password") == 0) {
       /* We found more than one inputs of type password; we won't be saving here. */
       if (password_node) {
         g_free (element_type);
@@ -398,7 +398,7 @@ ephy_web_dom_utils_find_form_auth_elements (WebKitDOMHTMLFormElement *form,
 
       /* We found an input that usually doesn't require a separate login
        * adminpw is used by mailman admin pages */
-      if (g_str_equal (element_name, "adminpw"))
+      if (g_strcmp0 (element_name, "adminpw") == 0)
         found_auth_no_username_elements = TRUE;
     }
 


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