mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2025-08-23 16:11:52 +08:00
fix possible NULL pointer dereference after call to configASSERT() (#1284)
Compiling with clang static code analysis, possible NULL pointer dereference are found. Since configASSERT() can possibly return and continue "normal" operation, the code in queue.c and stream_buffer.c can be adjusted to avoid NULL pointer exceptions. Signed-off-by: Florian La Roche <Florian.LaRoche@gmail.com>
This commit is contained in:
@ -1653,11 +1653,9 @@ void vStreamBufferSetStreamBufferNotificationIndex( StreamBufferHandle_t xStream
|
||||
|
||||
traceENTER_vStreamBufferSetStreamBufferNotificationIndex( xStreamBuffer, uxNotificationIndex );
|
||||
|
||||
configASSERT( pxStreamBuffer );
|
||||
|
||||
/* There should be no task waiting otherwise we'd never resume them. */
|
||||
configASSERT( pxStreamBuffer->xTaskWaitingToReceive == NULL );
|
||||
configASSERT( pxStreamBuffer->xTaskWaitingToSend == NULL );
|
||||
configASSERT( ( pxStreamBuffer != NULL ) && ( pxStreamBuffer->xTaskWaitingToReceive == NULL ) );
|
||||
configASSERT( ( pxStreamBuffer != NULL ) && ( pxStreamBuffer->xTaskWaitingToSend == NULL ) );
|
||||
|
||||
/* Check that the task notification index is valid. */
|
||||
configASSERT( uxNotificationIndex < configTASK_NOTIFICATION_ARRAY_ENTRIES );
|
||||
|
Reference in New Issue
Block a user