aboutsummaryrefslogtreecommitdiff
path: root/util/hash.cc
diff options
context:
space:
mode:
authorVictor Costan <costan@google.com>2025-01-30 09:32:59 -0800
committerVictor Costan <costan@google.com>2025-01-30 09:32:59 -0800
commitac691084fdc5546421a55b25e7653d450e5a25fb (patch)
tree5ceb2f8c7a6aa12d3aad31ca4e001174143a90ae /util/hash.cc
parente829478c6a3a55d8e5c1227e2678dcc18d518609 (diff)
parent4ee78d7ea98330f7d7599c42576ca99e3c6ff9c5 (diff)
downloadleveldb-main.tar.gz
leveldb-main.zip
Merge pull request #1249 from victorvianna:mainHEADmain
PiperOrigin-RevId: 721407764
Diffstat (limited to 'util/hash.cc')
-rw-r--r--util/hash.cc2
1 files changed, 1 insertions, 1 deletions
diff --git a/util/hash.cc b/util/hash.cc
index 8122fa8..fa252c7 100644
--- a/util/hash.cc
+++ b/util/hash.cc
@@ -27,7 +27,7 @@ uint32_t Hash(const char* data, size_t n, uint32_t seed) {
uint32_t h = seed ^ (n * m);
// Pick up four bytes at a time
- while (data + 4 <= limit) {
+ while (limit - data >= 4) {
uint32_t w = DecodeFixed32(data);
data += 4;
h += w;