From 131f7cfd71c54d67886d5501ace4d2bc7aa2a876 Mon Sep 17 00:00:00 2001 From: Denis Kasak Date: Tue, 13 Jul 2021 15:04:20 +0200 Subject: [PATCH] Fix off-by-one comparison error when unpickling uint32_t. --- src/pickle.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pickle.cpp b/src/pickle.cpp index d69fa98..f0e8f2f 100644 --- a/src/pickle.cpp +++ b/src/pickle.cpp @@ -30,7 +30,7 @@ std::uint8_t const * olm::unpickle( std::uint32_t & value ) { value = 0; - if (!pos || end <= pos + 4) return nullptr; + if (!pos || end < pos + 4) return nullptr; for (unsigned i = 4; i--;) { value <<= 8; value |= *(pos++); } return pos; }