diff options
Diffstat (limited to 'c/src/exec/score/src/heapallocate.c')
-rw-r--r-- | c/src/exec/score/src/heapallocate.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/c/src/exec/score/src/heapallocate.c b/c/src/exec/score/src/heapallocate.c index 661a4ba0f7..3699a6b080 100644 --- a/c/src/exec/score/src/heapallocate.c +++ b/c/src/exec/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; |