From e07d37ede8a55b86589732425dfa766537b2c6af Mon Sep 17 00:00:00 2001 From: SChernykh <15806605+SChernykh@users.noreply.github.com> Date: Thu, 9 May 2024 21:55:30 +0200 Subject: [PATCH] Fixed overflow check --- src/util.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.h b/src/util.h index 915edee..9636e9d 100644 --- a/src/util.h +++ b/src/util.h @@ -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; }