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.
This commit is contained in:
Joel Sherrill
2004-07-24 17:20:16 +00:00
parent e3da6673b5
commit 508023527b
2 changed files with 15 additions and 2 deletions

View File

@@ -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> 2004-07-14 Joel Sherrill <joel@OARcorp.com>
PR 650/rtems PR 650/rtems

View File

@@ -44,10 +44,16 @@ boolean _Heap_Size_of_user_area(
Heap_Block *next_block; Heap_Block *next_block;
unsigned32 the_size; 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 ); the_block = _Heap_User_block_at( starting_address );
if ( !_Heap_Is_block_in( the_heap, the_block ) || if ( !_Heap_Is_block_in( the_heap, the_block ) )
_Heap_Is_block_free( the_block ) ) return( FALSE );
if ( _Heap_Is_block_free( the_block ) )
return( FALSE ); return( FALSE );
the_size = _Heap_Block_size( the_block ); the_size = _Heap_Block_size( the_block );