Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport https://crrev.com/c/5955393 (uplift to 1.72.x) #26196

Merged
merged 1 commit into from
Oct 28, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
diff --git a/components/safe_browsing/core/browser/db/v4_store.cc b/components/safe_browsing/core/browser/db/v4_store.cc
index 8e687f813c92e49927be6089b85b9348683ef2f2..0ce972859b2acddf72c69e14b980ec3072b0927e 100644
--- a/components/safe_browsing/core/browser/db/v4_store.cc
+++ b/components/safe_browsing/core/browser/db/v4_store.cc
@@ -1007,10 +1007,11 @@ bool V4Store::VerifyChecksum() {

IteratorMap iterator_map;
HashPrefixStr next_smallest_prefix;
- InitializeIteratorMap(hash_prefix_map_->view(), &iterator_map);
- CHECK_EQ(hash_prefix_map_->view().size(), iterator_map.size());
- bool has_unmerged = GetNextSmallestUnmergedPrefix(
- hash_prefix_map_->view(), iterator_map, &next_smallest_prefix);
+ HashPrefixMapView map_view = hash_prefix_map_->view();
+ InitializeIteratorMap(map_view, &iterator_map);
+ CHECK_EQ(map_view.size(), iterator_map.size());
+ bool has_unmerged = GetNextSmallestUnmergedPrefix(map_view, iterator_map,
+ &next_smallest_prefix);

std::unique_ptr<crypto::SecureHash> checksum_ctx(
crypto::SecureHash::Create(crypto::SecureHash::SHA256));
@@ -1025,8 +1026,8 @@ bool V4Store::VerifyChecksum() {
next_smallest_prefix_size);

// Find the next smallest unmerged element in the map.
- has_unmerged = GetNextSmallestUnmergedPrefix(
- hash_prefix_map_->view(), iterator_map, &next_smallest_prefix);
+ has_unmerged = GetNextSmallestUnmergedPrefix(map_view, iterator_map,
+ &next_smallest_prefix);
}

std::array<char, crypto::kSHA256Length> checksum;
Loading