Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 - FreeRTOS#534 Signed-off-by: Gaurav Aggarwal <aggarg@amazon.com>
- Loading branch information