mirror of
https://github.com/apache/nuttx.git
synced 2026-05-29 20:56:47 +08:00
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:
@@ -76,11 +76,7 @@ FAR void *mm_malloc(FAR struct mm_heap_s *heap, size_t size)
|
|||||||
|
|
||||||
/* Handle bad sizes */
|
/* Handle bad sizes */
|
||||||
|
|
||||||
#ifndef CONFIG_MM_SMALL
|
if (size < 1 || size > (MMSIZE_MAX - SIZEOF_MM_ALLOCNODE))
|
||||||
if (size < 1 || size > (UINT32_MAX - SIZEOF_MM_ALLOCNODE))
|
|
||||||
#else
|
|
||||||
if (size < 1 || size > (UINT16_MAX - SIZEOF_MM_ALLOCNODE))
|
|
||||||
#endif
|
|
||||||
{
|
{
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user