Index: components/sync/syncable/directory_backing_store.cc |
diff --git a/components/sync/syncable/directory_backing_store.cc b/components/sync/syncable/directory_backing_store.cc |
index b17ff27522c08c7659bf0c44585193f1cd4dfe93..bda092dbb90ab4434e40890280796bf190a07086 100644 |
--- a/components/sync/syncable/directory_backing_store.cc |
+++ b/components/sync/syncable/directory_backing_store.cc |
@@ -27,6 +27,7 @@ |
#include "components/sync/protocol/bookmark_specifics.pb.h" |
#include "components/sync/protocol/sync.pb.h" |
#include "components/sync/syncable/syncable_columns.h" |
+#include "components/sync/syncable/syncable_id.h" |
#include "components/sync/syncable/syncable_util.h" |
#include "sql/connection.h" |
#include "sql/error_delegate_util.h" |
@@ -1642,6 +1643,8 @@ bool DirectoryBackingStore::CreateShareInfoTableVersion71( |
// This function checks to see if the given list of Metahandles has any nodes |
// whose PARENT_ID values refer to ID values that do not actually exist. |
+// This function also checks that a root node with the correct id exists in the |
+// set. |
// Returns true on success. |
bool DirectoryBackingStore::VerifyReferenceIntegrity( |
const Directory::MetahandlesMap* handles_map) { |
@@ -1667,6 +1670,9 @@ bool DirectoryBackingStore::VerifyReferenceIntegrity( |
} |
} |
} |
+ if (ids_set.find(Id::GetRoot().value()) == ids_set.end()) { |
+ return false; |
+ } |
return is_ok; |
} |