masc2008 commented on code in PR #19146:
URL: https://github.com/apache/nuttx/pull/19146#discussion_r3444896331


##########
mm/mm_gran/mm_graninit.c:
##########
@@ -124,6 +124,15 @@ GRAN_HANDLE gran_initialize(FAR void *heapstart, size_t 
heapsize,
   alignedsize  = (heapend - alignedstart) & ~mask;
   ngranules    = alignedsize >> log2gran;
 
+  /* Reject oversized pools. */
+
+  DEBUGASSERT(ngranules > 0 && ngranules <= UINT16_MAX);
+  if (ngranules == 0 || ngranules > UINT16_MAX)
+    {
+      set_errno(EINVAL);

Review Comment:
   thanks, and done.



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

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to