diff options
Diffstat (limited to 'cpukit/score/src/heapsizeofuserarea.c')
-rw-r--r-- | cpukit/score/src/heapsizeofuserarea.c | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/cpukit/score/src/heapsizeofuserarea.c b/cpukit/score/src/heapsizeofuserarea.c index b140247afe..3321816c4a 100644 --- a/cpukit/score/src/heapsizeofuserarea.c +++ b/cpukit/score/src/heapsizeofuserarea.c @@ -44,10 +44,16 @@ boolean _Heap_Size_of_user_area( Heap_Block *next_block; uint32_t the_size; + if ( !_Addresses_Is_in_range( + starting_address, (void *)the_heap->start, (void *)the_heap->final ) ) + return( FALSE ); + the_block = _Heap_User_block_at( starting_address ); + + if ( !_Heap_Is_block_in( the_heap, the_block ) ) + return( FALSE ); - if ( !_Heap_Is_block_in( the_heap, the_block ) || - _Heap_Is_block_free( the_block ) ) + if ( _Heap_Is_block_free( the_block ) ) return( FALSE ); the_size = _Heap_Block_size( the_block ); @@ -60,3 +66,4 @@ boolean _Heap_Size_of_user_area( *size = the_size; return( TRUE ); } + |