Commit c85827ce authored by Denis Kasak's avatar Denis Kasak
Browse files

Fix off-by-one comparison error when unpickling uint32_t.

parent 63a200d1
Pipeline #7713 passed with stages
in 2 minutes and 27 seconds
...@@ -30,7 +30,7 @@ std::uint8_t const * olm::unpickle( ...@@ -30,7 +30,7 @@ std::uint8_t const * olm::unpickle(
std::uint32_t & value std::uint32_t & value
) { ) {
value = 0; 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++); } for (unsigned i = 4; i--;) { value <<= 8; value |= *(pos++); }
return pos; return pos;
} }
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment