This is an automated email from the ASF dual-hosted git repository.

linguini pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx.git


The following commit(s) were added to refs/heads/master by this push:
     new 64d191d32e3 mm/mm_gran: fix data truncation by using size_t for mask
64d191d32e3 is described below

commit 64d191d32e3008866f4fd06b22db4a53b163098d
Author: liang.huang <[email protected]>
AuthorDate: Thu Feb 5 17:56:34 2026 -0800

    mm/mm_gran: fix data truncation by using size_t for mask
    
    Use size_t instead of unsigned int for 'mask' to avoid address truncation,
    especially when memory addresses exceed 32 bits.
    
    Signed-off-by: liang.huang <[email protected]>
---
 mm/mm_gran/mm_graninit.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/mm/mm_gran/mm_graninit.c b/mm/mm_gran/mm_graninit.c
index 777889de15f..0ae0e4cf8b5 100644
--- a/mm/mm_gran/mm_graninit.c
+++ b/mm/mm_gran/mm_graninit.c
@@ -99,7 +99,7 @@ GRAN_HANDLE gran_initialize(FAR void *heapstart, size_t 
heapsize,
   FAR struct gran_s *priv;
   uintptr_t          heapend;
   uintptr_t          alignedstart;
-  unsigned int       mask;
+  size_t             mask;
   unsigned int       alignedsize;
   unsigned int       ngranules;
 

Reply via email to