From c35d1d420f9917c5e6fe536cf7b4a273b198222f Mon Sep 17 00:00:00 2001 From: Mark Haines Date: Tue, 11 Aug 2015 13:14:06 +0100 Subject: Check that the end of input hasn't been reached when unpickling a list --- include/olm/pickle.hh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'include') 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); } -- cgit v1.2.3