You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2020/03/06 15:51:20 UTC

[GitHub] [incubator-nuttx] patacongo commented on a change in pull request #460: Prevents NuttX crashing if MM_REGIONS is too small.

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.

----------------------------------------------------------------
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:
users@infra.apache.org


With regards,
Apache Git Services