1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2025-12-25 14:33:52 +01:00

cbor: fix integer overflow in decode_bytes

This commit is contained in:
Sören Tempel 2017-10-10 13:24:52 +02:00
parent a295b0eb91
commit 8255810bab

View File

@ -400,7 +400,7 @@ static size_t decode_bytes(const cbor_stream_t *s, size_t offset, char *out, siz
return 0;
}
if (length < bytes_length + 1) {
if (bytes_length == SIZE_MAX || length < bytes_length + 1) {
return 0;
}