From fff1b2068c1fc5a02b129243bdb02723a00cb3f7 Mon Sep 17 00:00:00 2001 From: Joel Sherrill Date: Sat, 24 Jul 2004 17:25:33 +0000 Subject: 2004-07-24 Joel Sherrill PR 659/rtems * score/src/heapsizeofuserarea.c: Check that address specified is in the heap. --- cpukit/ChangeLog | 6 ++++++ cpukit/score/src/heapsizeofuserarea.c | 11 +++++++++-- 2 files changed, 15 insertions(+), 2 deletions(-) (limited to 'cpukit') diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index b062fb23b3..61e345aac6 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,3 +1,9 @@ +2004-07-24 Joel Sherrill + + PR 659/rtems + * score/src/heapsizeofuserarea.c: Check that address specified is in + the heap. + 2004-07-24 Joel Sherrill PR 652/rtems 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 ); } + -- cgit v1.2.3