aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/olm/pickle.hh2
1 files changed, 1 insertions, 1 deletions
diff --git a/include/olm/pickle.hh b/include/olm/pickle.hh
index 7a2bd1b..27f1f26 100644
--- a/include/olm/pickle.hh
+++ b/include/olm/pickle.hh
@@ -109,7 +109,7 @@ std::uint8_t const * unpickle(
) {
std::uint32_t size;
pos = unpickle(pos, end, size);
- while (size--) {
+ while (size-- && pos != end) {
T * value = list.insert(list.end());
pos = unpickle(pos, end, *value);
}