Check that the end of input hasn't been reached when unpickling a list

This commit is contained in:
Mark Haines 2015-08-11 13:14:06 +01:00
parent 158f7ee891
commit c35d1d420f

View file

@ -109,7 +109,7 @@ std::uint8_t const * unpickle(
) { ) {
std::uint32_t size; std::uint32_t size;
pos = unpickle(pos, end, size); pos = unpickle(pos, end, size);
while (size--) { while (size-- && pos != end) {
T * value = list.insert(list.end()); T * value = list.insert(list.end());
pos = unpickle(pos, end, *value); pos = unpickle(pos, end, *value);
} }