mirror of
https://github.com/FreeRTOS/FreeRTOS-Kernel.git
synced 2026-10-09 23:53:04 -04:00
Validate timer command ID lower bound in xTimerGenericCommandFromTask (#1477)
The task command path validated the command ID only against the upper bound. Add the corresponding lower-bound check so the accepted range is fully constrained.
This commit is contained in:
parent
ce36e04208
commit
a0e2097c6a
1 changed files with 4 additions and 2 deletions
6
timers.c
6
timers.c
|
|
@ -467,9 +467,11 @@
|
|||
xMessage.u.xTimerParameters.xMessageValue = xOptionalValue;
|
||||
xMessage.u.xTimerParameters.pxTimer = xTimer;
|
||||
|
||||
configASSERT( xCommandID < tmrFIRST_FROM_ISR_COMMAND );
|
||||
/* Enforce a lower bound as well as an upper bound so that only
|
||||
* valid task-issued commands are accepted here. */
|
||||
configASSERT( ( xCommandID >= tmrCOMMAND_START_DONT_TRACE ) && ( xCommandID < tmrFIRST_FROM_ISR_COMMAND ) );
|
||||
|
||||
if( xCommandID < tmrFIRST_FROM_ISR_COMMAND )
|
||||
if( ( xCommandID >= tmrCOMMAND_START_DONT_TRACE ) && ( xCommandID < tmrFIRST_FROM_ISR_COMMAND ) )
|
||||
{
|
||||
if( xTaskGetSchedulerState() == taskSCHEDULER_RUNNING )
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue