Messenger.c:

- unbroke Messenger_load(): lost a length adjustment
- addeditional check for enough data available
This commit is contained in:
Coren[m] 2013-09-11 21:22:43 +02:00
parent 513e37815d
commit ef86109460

View File

@ -1024,8 +1024,13 @@ int Messenger_load(Messenger *m, uint8_t *data, uint32_t length)
data += size;
length -= size;
if (length < sizeof(size))
return -1;
memcpy(&size, data, sizeof(size));
data += sizeof(size);
length -= sizeof(size);
if (length < size)
return -1;