This repository has been archived on 2023-11-05. You can view files and clone it, but cannot push or open issues or pull requests.
FreeRTOS-Kernel/portable/MemMang
Gaurav Aggarwal 618e165fa7 Fix NULL pointer dereference in vPortGetHeapStats
When the heap is exhausted (no free block), start and end markers are
the only blocks present in the free block list:

     +---------------+     +-----------> NULL
     |               |     |
     |               V     |
+ ----- +            + ----- +
|   |   |            |   |   |
|   |   |            |   |   |
+ ----- +            + ----- +
  xStart               pxEnd

The code block which traverses the list of free blocks to calculate heap
stats used a do..while loop that moved past the end marker when the heap
had no free block resulting in a NULL pointer dereference. This commit
changes the do..while loop to while loop thereby ensuring that we never
move past the end marker.

This was reported here - https://github.com/FreeRTOS/FreeRTOS-Kernel/issues/534

Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
2022-08-04 09:57:59 -07:00
..
heap_1.c Declare vApplicationMallocFailedHook function in task.h instead in each C heap file (#483) 2022-04-13 10:44:14 -07:00
heap_2.c Declare vApplicationMallocFailedHook function in task.h instead in each C heap file (#483) 2022-04-13 10:44:14 -07:00
heap_3.c Aligned nullptr check for heap3. (#493) 2022-05-17 22:26:01 +05:30
heap_4.c Fix NULL pointer dereference in vPortGetHeapStats 2022-08-04 09:57:59 -07:00
heap_5.c Fix NULL pointer dereference in vPortGetHeapStats 2022-08-04 09:57:59 -07:00
ReadMe.url Style: Make freertos.org = FreeRTOS.org and add https (#134) 2020-08-21 11:30:39 -07:00

[{000214A0-0000-0000-C000-000000000046}]
Prop3=19,2
[InternetShortcut]
URL=https://www.FreeRTOS.org/a00111.html
IDList=