Don't allow allocation of zero sized area.
git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15700 a95241bf-73f2-0310-859d-f6bbb57e9c96
This commit is contained in:
@@ -15,6 +15,9 @@
|
||||
status_t
|
||||
platform_allocate_region(void **_address, size_t size, uint8 protection)
|
||||
{
|
||||
if (size == 0)
|
||||
return B_BAD_VALUE;
|
||||
|
||||
void *address = arch_mmu_allocate(*_address, size, protection);
|
||||
if (address == NULL)
|
||||
return B_NO_MEMORY;
|
||||
|
||||
Reference in New Issue
Block a user