patacongo commented on a change in pull request #460: Prevents NuttX crashing if MM_REGIONS is too small. URL: https://github.com/apache/incubator-nuttx/pull/460#discussion_r388982165
########## File path: mm/mm_heap/mm_initialize.c ########## @@ -75,6 +75,13 @@ void mm_addregion(FAR struct mm_heap_s *heap, FAR void *heapstart, uintptr_t heapend; #if CONFIG_MM_REGIONS > 1 int IDX = heap->mm_nregions; + + /* Writing past CONFIG_MM_REGIONS would have catastrophic consequences */ + DEBUGASSERT(IDX < CONFIG_MM_REGIONS); Review comment: Coding standard requires a blank line after each comment. tools/nxstyle should have caught this. I will go ahead with the merge and correct that. ---------------------------------------------------------------- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. For queries about this service, please contact Infrastructure at: [email protected] With regards, Apache Git Services
