mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2026-10-09 23:53:04 -04:00
fix: Verify queue set type during usage (#1476)
Verify that a queue set is passed when attempting to add a queue to the queue set.
This commit is contained in:
parent
ce221a8bb4
commit
5f109e6f55
1 changed files with 10 additions and 1 deletions
11
queue.c
11
queue.c
|
|
@ -3225,7 +3225,16 @@ BaseType_t xQueueIsQueueFullFromISR( const QueueHandle_t xQueue )
|
|||
|
||||
taskENTER_CRITICAL();
|
||||
{
|
||||
if( ( ( Queue_t * ) xQueueOrSemaphore )->pxQueueSetContainer != NULL )
|
||||
if( ( ( Queue_t * ) xQueueSet )->uxItemSize != ( UBaseType_t ) sizeof( Queue_t * ) )
|
||||
{
|
||||
/* The object passed as the queue set is not a queue set. A queue
|
||||
* set always has an item size of sizeof( Queue_t * ). Reject any
|
||||
* other object to prevent a type confusion in which
|
||||
* prvNotifyQueueSetContainer() would later copy uxItemSize bytes
|
||||
* from a single pointer on the stack. */
|
||||
xReturn = pdFAIL;
|
||||
}
|
||||
else if( ( ( Queue_t * ) xQueueOrSemaphore )->pxQueueSetContainer != NULL )
|
||||
{
|
||||
/* Cannot add a queue/semaphore to more than one queue set. */
|
||||
xReturn = pdFAIL;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue