summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGabriel Ivascu <gabrielivascu@gnome.org>2017-08-25 23:48:36 +0300
committerGabriel Ivascu <gabrielivascu@gnome.org>2017-08-26 00:22:47 +0300
commit3980ca9081a646f6e680271a10645945f119a315 (patch)
tree3fbb09dff21bdf616b8cf97e1972b6bd6fe5281e
parent93cb509f0995895348e62ced6093b681b2af0797 (diff)
downloadepiphany-3980ca9081a646f6e680271a10645945f119a315.tar.gz
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
-rw-r--r--lib/sync/ephy-password-manager.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/sync/ephy-password-manager.c b/lib/sync/ephy-password-manager.c
index 9a491ffa0..a025c0e1d 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);
}