Added protection for xQueueGenericCreate

This commit is contained in:
David Chalco 2020-06-22 12:52:10 -07:00
parent 359b10a4ea
commit 0c9b3fc8b7

View file

@ -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