[PATCH 3/4] sapi: Add check for null extensions.

Sebastian Huber sebastian.huber at embedded-brains.de
Fri Apr 18 16:49:31 UTC 2014


On 04/18/2014 05:02 PM, Jennifer Averett wrote:
> ---
>   cpukit/sapi/src/extensioncreate.c | 3 +++
>   1 file changed, 3 insertions(+)
>
> diff --git a/cpukit/sapi/src/extensioncreate.c b/cpukit/sapi/src/extensioncreate.c
> index 8442096..59d37e6 100644
> --- a/cpukit/sapi/src/extensioncreate.c
> +++ b/cpukit/sapi/src/extensioncreate.c
> @@ -39,6 +39,9 @@ rtems_status_code rtems_extension_create(
>     if ( !rtems_is_name_valid( name ) )
>       return RTEMS_INVALID_NAME;
>   
> +  if (! _User_extensions_Is_valid( extension_table ))
> +    return RTEMS_INVALID_ADDRESS;
> +
>     the_extension = _Extension_Allocate();
>   
>     if ( !the_extension ) {

This is wrong.  NULL pointers for the callouts are valid.

-- 
Sebastian Huber, embedded brains GmbH

Address : Dornierstr. 4, D-82178 Puchheim, Germany
Phone   : +49 89 189 47 41-16
Fax     : +49 89 189 47 41-09
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 devel mailing list