diff --git a/queue.c b/queue.c index b30d21215..9d9830330 100644 --- a/queue.c +++ b/queue.c @@ -378,6 +378,9 @@ Queue_t * const pxQueue = xQueue; zero in the case the queue is used as a semaphore. */ xQueueSizeInBytes = ( size_t ) ( uxQueueLength * uxItemSize ); /*lint !e961 MISRA exception as the casts are only redundant for some ports. */ + /* Check for multiplication overflow */ + configASSERT( uxItemSize == 0 || uxQueueLength == xQueueSizeInBytes / uxItemSize ); + /* Allocate the queue and storage area. Justification for MISRA deviation as follows: pvPortMalloc() always ensures returned memory blocks are aligned per the requirements of the MCU stack. In this case