diff options
author | Joel Sherrill <joel.sherrill@OARcorp.com> | 2004-07-24 17:20:16 +0000 |
---|---|---|
committer | Joel Sherrill <joel.sherrill@OARcorp.com> | 2004-07-24 17:20:16 +0000 |
commit | 508023527bd521eb6a388c3ec5e0eabf25217833 (patch) | |
tree | 3e60a49f8bc37b36be1526fe5493a4f42f54a6c5 /cpukit/score | |
parent | Fix format. (diff) | |
download | rtems-508023527bd521eb6a388c3ec5e0eabf25217833.tar.bz2 |
2004-07-24 Joel Sherrill <joel@OARcorp.com>
PR 659/rtems
* src/heapsizeofuserarea.c, src/objectmp.c, src/threadinitialize.c,
src/threadstackallocate.c: Check that address specified is in the
heap.
Diffstat (limited to 'cpukit/score')
-rw-r--r-- | cpukit/score/ChangeLog | 7 | ||||
-rw-r--r-- | cpukit/score/src/heapsizeofuserarea.c | 10 |
2 files changed, 15 insertions, 2 deletions
diff --git a/cpukit/score/ChangeLog b/cpukit/score/ChangeLog index 903db628ad..23e68aaacd 100644 --- a/cpukit/score/ChangeLog +++ b/cpukit/score/ChangeLog @@ -1,3 +1,10 @@ +2004-07-24 Joel Sherrill <joel@OARcorp.com> + + PR 659/rtems + * src/heapsizeofuserarea.c, src/objectmp.c, src/threadinitialize.c, + src/threadstackallocate.c: Check that address specified is in the + heap. + 2004-07-14 Joel Sherrill <joel@OARcorp.com> PR 650/rtems diff --git a/cpukit/score/src/heapsizeofuserarea.c b/cpukit/score/src/heapsizeofuserarea.c index 60ee7d033b..e07477dc4e 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; unsigned32 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 ) || - _Heap_Is_block_free( the_block ) ) + if ( !_Heap_Is_block_in( the_heap, the_block ) ) + return( FALSE ); + + if ( _Heap_Is_block_free( the_block ) ) return( FALSE ); the_size = _Heap_Block_size( the_block ); |