diff --git a/src/ripple/nodestore/impl/varint.h b/src/ripple/nodestore/impl/varint.h index e74f53afd..75d8e58a7 100644 --- a/src/ripple/nodestore/impl/varint.h +++ b/src/ripple/nodestore/impl/varint.h @@ -55,6 +55,8 @@ template 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(buf); std::size_t n = 0;