mirror of
https://github.com/google/leveldb.git
synced 2025-01-27 06:30:07 +08:00
Check for integer overflow in Block::Iter::ParseNextKey.
This commit is contained in:
parent
d328a35b5c
commit
294330e8e5
@ -268,7 +268,8 @@ class Block::Iter : public Iterator {
|
||||
uint32_t shared, non_shared, value_length;
|
||||
p = DecodeEntry(p, limit, &shared, &non_shared, &value_length);
|
||||
if (p == nullptr || key_.size() < shared ||
|
||||
(comparator_->IsInternal() && shared + non_shared < 8)) {
|
||||
(comparator_->IsInternal() &&
|
||||
static_cast<uint64_t>(shared) + non_shared < 8)) {
|
||||
CorruptionError();
|
||||
return false;
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user