[epiphany] password-manager: Handle invalid input from gnome-keyring



commit 3980ca9081a646f6e680271a10645945f119a315
Author: Gabriel Ivascu <gabrielivascu gnome org>
Date:   Fri Aug 25 23:48:36 2017 +0300

    password-manager: Handle invalid input from gnome-keyring
    
    Although unlikely, gnome-keyring data may get broken or corrupted
    for whatever reason. Epiphany should not crash in that case.
    
    https://bugzilla.gnome.org/show_bug.cgi?id=786811

 lib/sync/ephy-password-manager.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
---
diff --git a/lib/sync/ephy-password-manager.c b/lib/sync/ephy-password-manager.c
index 9a491ff..a025c0e 100644
--- a/lib/sync/ephy-password-manager.c
+++ b/lib/sync/ephy-password-manager.c
@@ -550,6 +550,11 @@ secret_service_search_cb (SecretService  *service,
     LOG ("Found password record for (%s, %s, %s, %s, %s)",
          hostname, target_origin, username, username_field, password_field);
 
+    if (!id || !hostname || !target_origin || !password_field || !timestamp) {
+      LOG ("Password record is corrupted, skipping it...");
+      goto next;
+    }
+
     record = ephy_password_record_new (id, hostname, target_origin,
                                        username, password,
                                        username_field, password_field,
@@ -560,6 +565,7 @@ secret_service_search_cb (SecretService  *service,
                                                   server_time_modified);
     records = g_list_prepend (records, record);
 
+next:
     secret_value_unref (value);
     g_hash_table_unref (attributes);
   }


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