From 68d3fc6f8feaa39b413daa13fa6c0985416af1c5 Mon Sep 17 00:00:00 2001 From: Ingo Weinhold Date: Wed, 28 Dec 2005 20:02:34 +0000 Subject: [PATCH] Don't allow allocation of zero sized area. git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@15700 a95241bf-73f2-0310-859d-f6bbb57e9c96 --- src/system/boot/platform/openfirmware/mmu.cpp | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/system/boot/platform/openfirmware/mmu.cpp b/src/system/boot/platform/openfirmware/mmu.cpp index 777c131449..85ecae23aa 100644 --- a/src/system/boot/platform/openfirmware/mmu.cpp +++ b/src/system/boot/platform/openfirmware/mmu.cpp @@ -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;