[epiphany] embed-shell: don't query username_field without username



commit 7b76a6a3826cfebf8e67a15f801f4cd3548436be
Author: Michael Catanzaro <mcatanzaro igalia com>
Date:   Mon Jun 10 15:33:34 2019 -0500

    embed-shell: don't query username_field without username
    
    Because we don't save username_field in the password manager if username
    is not provided, we won't ever be able to successfully look up passwords
    in this case unless we clear it here, too.

 embed/ephy-embed-shell.c | 7 +++++++
 1 file changed, 7 insertions(+)
---
diff --git a/embed/ephy-embed-shell.c b/embed/ephy-embed-shell.c
index 45cc66600..d7d2bbf03 100644
--- a/embed/ephy-embed-shell.c
+++ b/embed/ephy-embed-shell.c
@@ -425,6 +425,13 @@ web_process_extension_password_manager_query_received_cb (WebKitUserContentManag
   if (!origin || !target_origin || !password_field)
     return;
 
+  /* Don't include username_field in queries unless we actually have a username
+   * to go along with it, or the query will fail because we don't save
+   * username_field without a corresponding username.
+   */
+  if (!username && username_field)
+    g_clear_pointer (&username_field, g_free);
+
   PasswordManagerData *data = g_new (PasswordManagerData, 1);
   data->shell = g_object_ref (shell);
   data->promise_id = promise_id;


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