Skip to content

Commit

Permalink
Improve handling of empty buffer in varint parsing (RIPD-1683)
Browse files Browse the repository at this point in the history
  • Loading branch information
HowardHinnant authored and nbougalis committed Jun 26, 2020
1 parent d69a902 commit 0214d83
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/ripple/nodestore/impl/varint.h
Expand Up @@ -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;
Expand Down

0 comments on commit 0214d83

Please sign in to comment.