1
0
mirror of https://github.com/RIOT-OS/RIOT.git synced 2024-12-29 04:50:03 +01:00

Merge pull request #14745 from benpicco/nanocoap-coverity

nanocoap: validate input with NDEBUG
This commit is contained in:
Martine Lenders 2020-08-12 07:43:51 +02:00 committed by GitHub
commit 76709fa453
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -377,6 +377,11 @@ int coap_get_blockopt(coap_pkt_t *pkt, uint16_t option, uint32_t *blknum, unsign
return -1;
}
if (option_len > 4) {
DEBUG("nanocoap: invalid option length\n");
return -1;
}
uint32_t blkopt = _decode_uint(data_start, option_len);
DEBUG("nanocoap: blkopt len: %i\n", option_len);