Skip to content

Commit 64d191d

Browse files
hitHuanglinguini1
authored andcommitted
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 <liang.huang@houmo.ai>
1 parent e8b3630 commit 64d191d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

mm/mm_gran/mm_graninit.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -99,7 +99,7 @@ GRAN_HANDLE gran_initialize(FAR void *heapstart, size_t heapsize,
9999
FAR struct gran_s *priv;
100100
uintptr_t heapend;
101101
uintptr_t alignedstart;
102-
unsigned int mask;
102+
size_t mask;
103103
unsigned int alignedsize;
104104
unsigned int ngranules;
105105

0 commit comments

Comments
 (0)