From b32d47ab98a9532c75c7d46b011bbd3010db8bf7 Mon Sep 17 00:00:00 2001 From: Sudeep Mohanty Date: Tue, 19 Mar 2024 17:33:18 +0100 Subject: [PATCH] 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. --- components/freertos/esp_additions/freertos_tasks_c_additions.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/components/freertos/esp_additions/freertos_tasks_c_additions.h b/components/freertos/esp_additions/freertos_tasks_c_additions.h index 9f3ffbb122..38af06e264 100644 --- a/components/freertos/esp_additions/freertos_tasks_c_additions.h +++ b/components/freertos/esp_additions/freertos_tasks_c_additions.h @@ -936,7 +936,7 @@ static List_t * pxGetTaskListByIndex( UBaseType_t 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 ]; }