[epiphany/mcatanzaro/password-manager-crash: 4/4] Fix crash when username_field is detected with no username



commit 55aa491c0b88daec192b101ea7c8b90bd76a167b
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Mon Apr 15 17:50:36 2019 -0500

    Fix crash when username_field is detected with no username
    
    The current code is obviously a mistake -- my bad -- since there's no
    point in freeing a variable that is known to be NULL.

 embed/ephy-embed-shell.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
---
diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c
index 35d1a57cd..18700b136 100644
--- a/embed/ephy-embed-shell.c
+++ b/embed/ephy-embed-shell.c
@@ -502,11 +502,11 @@ web_extension_password_manager_save_real (EphyEmbedShell *shell,
 
   /* The username field is required if username is present. */
   if (username && !username_field)
-    g_clear_pointer (&username_field, g_free);
+    g_clear_pointer (&username, g_free);
 
   /* The username is required if username field is present. */
   if (!username && username_field)
-    g_clear_pointer (&username, g_free);
+    g_clear_pointer (&username_field, g_free);
 
   /* This also sanity checks that a page isn't saving websites for
    * other origins. Remember the request comes from the untrusted web


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