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:47:51 UTC

[GitHub] [incubator-nuttx] anpaza opened a new pull request #460: Prevents NuttX crashing if MM_REGIONS is too small.

anpaza opened a new pull request #460: Prevents NuttX crashing if MM_REGIONS is too small.
URL: https://github.com/apache/incubator-nuttx/pull/460
 
 
   Added a DEBUGASSERT and a runtime check so that mm_region will not
   overwrite critical heap data if user incorrectly defines MM_REGIONS.

----------------------------------------------------------------
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

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

Posted by GitBox <gi...@apache.org>.
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:
users@infra.apache.org


With regards,
Apache Git Services

[GitHub] [incubator-nuttx] patacongo merged pull request #460: Prevents NuttX crashing if MM_REGIONS is too small.

Posted by GitBox <gi...@apache.org>.
patacongo merged pull request #460: Prevents NuttX crashing if MM_REGIONS is too small.
URL: https://github.com/apache/incubator-nuttx/pull/460
 
 
   

----------------------------------------------------------------
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

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

Posted by GitBox <gi...@apache.org>.
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