aboutsummaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorMark Haines <mark.haines@matrix.org>2015-08-11 13:14:06 +0100
committerMark Haines <mark.haines@matrix.org>2015-08-11 13:14:06 +0100
commitc35d1d420f9917c5e6fe536cf7b4a273b198222f (patch)
tree4d9a41f7e9e9fc9b088becb2922109c1e6f4c815 /include
parent158f7ee8919929b4daefb484d1a232d367d0c8e5 (diff)
Check that the end of input hasn't been reached when unpickling a list
Diffstat (limited to 'include')
-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);
}