mirror of
https://github.com/Xahau/xahaud.git
synced 2025-12-06 17:27:52 +00:00
Improve handling of empty buffer in varint parsing (RIPD-1683)
This commit is contained in:
committed by
Nik Bougalis
parent
d69a902876
commit
0214d83aa5
@@ -55,6 +55,8 @@ template <class = void>
|
||||
std::size_t
|
||||
read_varint(void const* buf, std::size_t buflen, std::size_t& t)
|
||||
{
|
||||
if (buflen == 0)
|
||||
return 0;
|
||||
t = 0;
|
||||
std::uint8_t const* p = reinterpret_cast<std::uint8_t const*>(buf);
|
||||
std::size_t n = 0;
|
||||
|
||||
Reference in New Issue
Block a user