Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(88)

Unified Diff: components/password_manager/core/browser/login_database.cc

Issue 202903002: [Password Manager] Fix possible crash when updating imported credentials. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: Merge Created 6 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | components/password_manager/core/browser/login_database_unittest.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: components/password_manager/core/browser/login_database.cc
diff --git a/components/password_manager/core/browser/login_database.cc b/components/password_manager/core/browser/login_database.cc
index dcd42e3e2d47d6d048664122a990e4c72c7079b3..cf825c618901e3ee990a7f4bb1da4398aea81234 100644
--- a/components/password_manager/core/browser/login_database.cc
+++ b/components/password_manager/core/browser/login_database.cc
@@ -287,8 +287,10 @@ bool LoginDatabase::UpdateLogin(const PasswordForm& form, int* items_changed) {
ENCRYPTION_RESULT_SUCCESS)
return false;
+ // Replacement is necessary to deal with updating imported credentials. See
+ // crbug.com/349138 for details.
sql::Statement s(db_.GetCachedStatement(SQL_FROM_HERE,
- "UPDATE logins SET "
+ "UPDATE OR REPLACE logins SET "
"action_url = ?, "
"password_value = ?, "
"ssl_valid = ?, "
« no previous file with comments | « no previous file | components/password_manager/core/browser/login_database_unittest.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698