mirror of
https://github.com/google/leveldb.git
synced 2025-06-07 18:02:42 +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;
|
uint32_t shared, non_shared, value_length;
|
||||||
p = DecodeEntry(p, limit, &shared, &non_shared, &value_length);
|
p = DecodeEntry(p, limit, &shared, &non_shared, &value_length);
|
||||||
if (p == nullptr || key_.size() < shared ||
|
if (p == nullptr || key_.size() < shared ||
|
||||||
(comparator_->IsInternal() && shared + non_shared < 8)) {
|
(comparator_->IsInternal() &&
|
||||||
|
static_cast<uint64_t>(shared) + non_shared < 8)) {
|
||||||
CorruptionError();
|
CorruptionError();
|
||||||
return false;
|
return false;
|
||||||
} else {
|
} else {
|
||||||
|
Loading…
Reference in New Issue
Block a user