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:
Gregory Nutt 2017-10-17 07:34:06 -06:00
parent 196911d4fa
commit 34a572b226
1 changed files with 1 additions and 5 deletions

View File

@ -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;
}