aboutsummaryrefslogtreecommitdiff
path: root/src/message.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/message.cpp')
-rw-r--r--src/message.cpp3
1 files changed, 3 insertions, 0 deletions
diff --git a/src/message.cpp b/src/message.cpp
index 93473b9..8e807fd 100644
--- a/src/message.cpp
+++ b/src/message.cpp
@@ -49,6 +49,9 @@ T varint_decode(
std::uint8_t const * varint_end
) {
T value = 0;
+ if (varint_end == varint_start) {
+ return 0;
+ }
do {
value <<= 7;
value |= 0x7F & *(--varint_end);