From 00be3d95bdb7115c37bbb0b056bb64eec2543119 Mon Sep 17 00:00:00 2001 From: Reto Schneider Date: Fri, 14 Jan 2022 19:00:44 +0100 Subject: [PATCH] codeql: Fix potential multiplication overflow CodeQL: > Multiplication result may overflow 'unsigned int' before it is > converted to 'unsigned long'. --- coap/block.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/coap/block.c b/coap/block.c index 1ae62dcbd..d521c9ee9 100644 --- a/coap/block.c +++ b/coap/block.c @@ -257,8 +257,7 @@ uint8_t prv_coap_block_handler(lwm2m_block_data_t ** pBlockDataHead, uint8_t * oldBuffer = blockData->blockBuffer; size_t oldSize = blockData->blockBufferSize; - if (blockData->blockBufferSize != blockSize * blockNum) - { + if (blockData->blockBufferSize != (size_t)blockSize * blockNum) { // we don't receive block in right order // TODO should we clean block1 data for this server ? return COAP_408_REQ_ENTITY_INCOMPLETE;