Added more checks to readVarint

This commit is contained in:
SChernykh
2025-06-23 07:47:43 +02:00
parent 1b863109f9
commit 10d583adb6
2 changed files with 13 additions and 0 deletions
+5
View File
@@ -186,6 +186,11 @@ const uint8_t* readVarint(const uint8_t* data, const uint8_t* data_end, T& b)
}
const uint64_t cur_byte = *(data++);
if (k && (cur_byte == 0)) {
return nullptr;
}
result |= (cur_byte & 0x7F) << k;
if ((k > 0) && (shiftleft128(cur_byte & 0x7F, 0, k) != 0)) {