Update last commit... Check should really use the definition MMSIZE_MAX which is really the same thing, but guaranteed to be the correct maximum size in any present and future configuration.
This commit is contained in:
parent
196911d4fa
commit
34a572b226
|
@ -76,11 +76,7 @@ FAR void *mm_malloc(FAR struct mm_heap_s *heap, size_t size)
|
|||
|
||||
/* Handle bad sizes */
|
||||
|
||||
#ifndef CONFIG_MM_SMALL
|
||||
if (size < 1 || size > (UINT32_MAX - SIZEOF_MM_ALLOCNODE))
|
||||
#else
|
||||
if (size < 1 || size > (UINT16_MAX - SIZEOF_MM_ALLOCNODE))
|
||||
#endif
|
||||
if (size < 1 || size > (MMSIZE_MAX - SIZEOF_MM_ALLOCNODE))
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue