summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/score/src')
-rw-r--r--cpukit/score/src/heapallocate.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/cpukit/score/src/heapallocate.c b/cpukit/score/src/heapallocate.c
index 661a4ba0f7..3699a6b080 100644
--- a/cpukit/score/src/heapallocate.c
+++ b/cpukit/score/src/heapallocate.c
@@ -43,7 +43,15 @@ void *_Heap_Allocate(
Heap_Block *temporary_block;
void *ptr;
unsigned32 offset;
-
+
+ /*
+ * Catch the case of a user allocating close to the limit of the
+ * unsigned32.
+ */
+
+ if ( size >= (-1 - HEAP_BLOCK_USED_OVERHEAD) )
+ return( NULL );
+
excess = size % the_heap->page_size;
the_size = size + the_heap->page_size + HEAP_BLOCK_USED_OVERHEAD;