fix(freertos): Fixed an issue where accessing task lists could overrun memory

This commit fixes a potential issue of illegal memory access when
accessing the various task lists in FreeRTOS while fetching tasks using
the xTaskGetNext() function.
This commit is contained in:
Sudeep Mohanty
2024-03-19 17:33:18 +01:00
parent 4005c24ce1
commit b32d47ab98

View File

@@ -936,7 +936,7 @@ static List_t * pxGetTaskListByIndex( UBaseType_t uxListIndex )
{ {
pxTaskList = &pxReadyTasksLists[ configMAX_PRIORITIES - 1 - uxListIndex ]; pxTaskList = &pxReadyTasksLists[ configMAX_PRIORITIES - 1 - uxListIndex ];
} }
else if( uxListIndex < configMAX_PRIORITIES + xNonReadyTaskListsCnt + 1 ) else if( uxListIndex < configMAX_PRIORITIES + xNonReadyTaskListsCnt )
{ {
pxTaskList = non_ready_task_lists[ uxListIndex - configMAX_PRIORITIES ]; pxTaskList = non_ready_task_lists[ uxListIndex - configMAX_PRIORITIES ];
} }