Skip to content

Commit

Permalink
Fixed overflow check
Browse files Browse the repository at this point in the history
  • Loading branch information
SChernykh committed May 9, 2024
1 parent f270b97 commit e07d37e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/util.h
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ const uint8_t* readVarint(const uint8_t* data, const uint8_t* data_end, T& b)
const uint64_t cur_byte = *(data++);
result |= (cur_byte & 0x7F) << k;

if (shiftleft128(cur_byte & 0x7F, 0, k) != 0) {
if ((k > 0) && (shiftleft128(cur_byte & 0x7F, 0, k) != 0)) {
return nullptr;
}

Expand Down

0 comments on commit e07d37e

Please sign in to comment.