From 42c935e2c389043cc8c72fe02f72eac36a421d30 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 38bd6ac9df0d..9fcf05dee56e 100644 --- a/components/freertos/esp_additions/freertos_tasks_c_additions.h +++ b/components/freertos/esp_additions/freertos_tasks_c_additions.h @@ -917,7 +917,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 ]; }