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

Unified Diff: sync/internal_api/write_node.cc

Issue 1915983003: [Sync] Fix crash in GCP when adding encrypted entry that already exists. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Removed HandleDecryptError() Created 4 years, 8 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 | « sync/internal_api/sync_manager_impl_unittest.cc ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sync/internal_api/write_node.cc
diff --git a/sync/internal_api/write_node.cc b/sync/internal_api/write_node.cc
index 0f57315122004a3a470ec2156c3c7c8a40938948..ff0a97f3094ea0b5aec8836c4d97f91aa44e91cf 100644
--- a/sync/internal_api/write_node.cc
+++ b/sync/internal_api/write_node.cc
@@ -374,6 +374,8 @@ WriteNode::InitUniqueByCreationResult WriteNode::InitUniqueByCreationImpl(
existing_entry->PutParentId(parent_id);
} // Else just reuse the existing entry.
entry_ = existing_entry.release();
+ if (!DecryptIfNecessary())
+ return INIT_FAILED_DECRYPT_EXISTING_ENTRY;
} else {
entry_ = new syncable::MutableEntry(transaction_->GetWrappedWriteTrans(),
syncable::CREATE,
« no previous file with comments | « sync/internal_api/sync_manager_impl_unittest.cc ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698