change log for rtems (2011-03-01)

Sebastian Huber sebastian.huber at embedded-brains.de
Tue Mar 1 08:26:59 UTC 2011


Hello Chris,

your changes are not right.

	(1) The _Heap_Free() must accept only NULL (which did not work due to a bug in
_Heap_Protection_block_check_default()) and a valid pointer to an allocated area.

	(2) The _Heap_Resize_block() must accept only a valid pointer to an allocated
area.

Does everyone agree with (1) and (2)?

Please look at realloc() for an usage of _Heap_Resize_block().

The heap protection helps to find invalid heap usages.  Like a double-free or a
free with a pointer to an invalid area.  Thus the checks must be performed
before the normal heap code.

We have two issues here.

	(A) _Heap_Free(*, NULL) returns false (debugging disabled).
	(B) _Heap_Free(*, NULL) yields an error (debugging enabled).

To address (B) we have to fix _Heap_Protection_block_check_default().

Case (A) is there for a long time.  We should change it to return true.

On 03/01/2011 07:10 AM, rtems-vc at rtems.org wrote:
> *ccj*
> 
> 2011-03-01      Chris Johns <chrisj at rtems.org>
> 
>         * score/src/heapfree.c, score/src/heapresizeblock.c: PR 1746. Move
>         protection block checks to after the block address has been
>         checked as a valid heap address. Add a special case in the heap
>         free for a NULL address.

-- 
Sebastian Huber, embedded brains GmbH

Address : Obere Lagerstr. 30, D-82178 Puchheim, Germany
Phone   : +49 89 18 90 80 79-6
Fax     : +49 89 18 90 80 79-9
E-Mail  : sebastian.huber at embedded-brains.de
PGP     : Public key available on request.

Diese Nachricht ist keine geschäftliche Mitteilung im Sinne des EHUG.



More information about the vc mailing list