From 33a160674659c8bff940dc34b0d786c53f8be729 Mon Sep 17 00:00:00 2001 From: brave-builds Date: Thu, 24 Oct 2024 15:11:04 +0000 Subject: [PATCH] Uplift of #26191 (squashed) to beta --- ...browsing-core-browser-db-v4_store.cc.patch | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 patches/components-safe_browsing-core-browser-db-v4_store.cc.patch diff --git a/patches/components-safe_browsing-core-browser-db-v4_store.cc.patch b/patches/components-safe_browsing-core-browser-db-v4_store.cc.patch new file mode 100644 index 000000000000..1ce46fafa45b --- /dev/null +++ b/patches/components-safe_browsing-core-browser-db-v4_store.cc.patch @@ -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 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 checksum;