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

Unified Diff: chrome/browser/importer/in_process_importer_bridge.cc

Issue 2646783002: Fixed synchronization autocomplete unrecoverable error. (Closed)
Patch Set: Fixed synchronization autocomplete unrecoverable error. Created 3 years, 11 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/autofill/core/browser/webdata/autocomplete_syncable_service.cc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/importer/in_process_importer_bridge.cc
diff --git a/chrome/browser/importer/in_process_importer_bridge.cc b/chrome/browser/importer/in_process_importer_bridge.cc
index 34b286ed3aed2e5d67edc7d52c53ab151e942e66..87ed9106e47b816b902ec7c0d0ca8e3e13858477 100644
--- a/chrome/browser/importer/in_process_importer_bridge.cc
+++ b/chrome/browser/importer/in_process_importer_bridge.cc
@@ -230,10 +230,15 @@ void InProcessImporterBridge::SetAutofillFormData(
const std::vector<ImporterAutofillFormDataEntry>& entries) {
std::vector<autofill::AutofillEntry> autofill_entries;
for (size_t i = 0; i < entries.size(); ++i) {
- autofill_entries.push_back(autofill::AutofillEntry(
- autofill::AutofillKey(entries[i].name, entries[i].value),
- entries[i].first_used,
- entries[i].last_used));
+ // Using method c_str() in order to avoid data which contains null
+ // terminating symbols.
+ base::string16 name = entries[i].name.c_str();
+ base::string16 value = entries[i].value.c_str();
gab 2017/01/20 01:57:15 const on both
+ if (name.empty() || value.empty())
+ continue;
+ autofill_entries.push_back(
+ autofill::AutofillEntry(autofill::AutofillKey(name, value),
+ entries[i].first_used, entries[i].last_used));
}
writer_->AddAutofillFormDataEntries(autofill_entries);
« no previous file with comments | « no previous file | components/autofill/core/browser/webdata/autocomplete_syncable_service.cc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698