Commit a410f9f8 authored by Mohamed Amir Yosef's avatar Mohamed Amir Yosef Committed by Commit Bot

[Sync::USS] FIX DCHECK crash due missing parent id in uss_migrator.cc

This CL checks bookmark fields for validity/existence before parsing
them when migrating from directory to USS architectures
in uss_migrator.cc.

The original problematic code has been introduced in:
https://chromium-review.googlesource.com/c/chromium/src/+/1162226

Bug: 516866,871671
Change-Id: I843c62325f3e3ec37ce05783c999bdfd5f3542a0
Reviewed-on: https://chromium-review.googlesource.com/1164946
Commit-Queue: Mohamed Amir Yosef <mamir@chromium.org>
Reviewed-by: default avatarMikel Astiz <mastiz@chromium.org>
Cr-Commit-Position: refs/heads/master@{#581186}
parent 47bfc59c
......@@ -44,9 +44,13 @@ bool ExtractSyncEntity(ReadTransaction* trans,
entity->set_client_defined_unique_tag(entry.GetUniqueClientTag());
// Required fields for bookmarks only.
entity->set_folder(entry.GetServerIsDir());
entity->set_parent_id_string(entry.GetServerParentId().GetServerId());
*entity->mutable_unique_position() =
entry.GetServerUniquePosition().ToProto();
if (!entry.GetServerParentId().IsNull()) {
entity->set_parent_id_string(entry.GetServerParentId().GetServerId());
}
if (entry.GetServerUniquePosition().IsValid()) {
*entity->mutable_unique_position() =
entry.GetServerUniquePosition().ToProto();
}
entity->set_server_defined_unique_tag(entry.GetUniqueServerTag());
// It looks like there are fancy other ways to get e.g. passwords specifics
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment