diff options
author | Mark Haines <mark.haines@matrix.org> | 2015-08-11 13:14:06 +0100 |
---|---|---|
committer | Mark Haines <mark.haines@matrix.org> | 2015-08-11 13:14:06 +0100 |
commit | c35d1d420f9917c5e6fe536cf7b4a273b198222f (patch) | |
tree | 4d9a41f7e9e9fc9b088becb2922109c1e6f4c815 /include/olm | |
parent | 158f7ee8919929b4daefb484d1a232d367d0c8e5 (diff) |
Check that the end of input hasn't been reached when unpickling a list
Diffstat (limited to 'include/olm')
-rw-r--r-- | include/olm/pickle.hh | 2 |
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); } |