diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2004-07-24 17:25:33 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2004-07-24 17:25:33 +0000 |
commit | fff1b2068c1fc5a02b129243bdb02723a00cb3f7 (patch) | |
tree | df109fbeb12c9bd1b607cfb8ad5c0d39fb91972c | |
parent | Fix format. (diff) | |
download | rtems-fff1b2068c1fc5a02b129243bdb02723a00cb3f7.tar.bz2 |
2004-07-24 Joel Sherrill <joel@OARcorp.com>
PR 659/rtems
* score/src/heapsizeofuserarea.c: Check that address specified is in
the heap.
-rw-r--r-- | cpukit/ChangeLog | 6 | ||||
-rw-r--r-- | cpukit/score/src/heapsizeofuserarea.c | 11 |
2 files changed, 15 insertions, 2 deletions
diff --git a/cpukit/ChangeLog b/cpukit/ChangeLog index b062fb23b3..61e345aac6 100644 --- a/cpukit/ChangeLog +++ b/cpukit/ChangeLog @@ -1,5 +1,11 @@ 2004-07-24 Joel Sherrill <joel@OARcorp.com> + PR 659/rtems + * score/src/heapsizeofuserarea.c: Check that address specified is in + the heap. + +2004-07-24 Joel Sherrill <joel@OARcorp.com> + PR 652/rtems * rtems/src/signalsend.c: Return RTEMS_INVALID_NUMBER when sending an empty signal set. 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 ); } + |