Changeset 3d73642 in rtems


Ignore:
Timestamp:
Apr 17, 2020, 8:00:15 AM (8 months ago)
Author:
Sebastian Huber <sebastian.huber@…>
Branches:
5, master
Children:
222d6879
Parents:
80cf60e
git-author:
Sebastian Huber <sebastian.huber@…> (04/17/20 08:00:15)
git-committer:
Sebastian Huber <sebastian.huber@…> (04/17/20 17:51:11)
Message:

sapi: Add param check to rtems_extension_create()

Check that the extensions table is not NULL. Change format.

Update #3953.

Files:
2 edited

Legend:

Unmodified
Added
Removed
  • cpukit/sapi/src/extensioncreate.c

    r80cf60e r3d73642  
    3333  Extension_Control *the_extension;
    3434
    35   if ( !id )
     35  if ( !rtems_is_name_valid( name ) ) {
     36    return RTEMS_INVALID_NAME;
     37  }
     38
     39  if ( extension_table == NULL ) {
    3640    return RTEMS_INVALID_ADDRESS;
     41  }
    3742
    38   if ( !rtems_is_name_valid( name ) )
    39     return RTEMS_INVALID_NAME;
     43  if ( id == NULL ) {
     44    return RTEMS_INVALID_ADDRESS;
     45  }
    4046
    4147  the_extension = _Extension_Allocate();
    4248
    43   if ( !the_extension ) {
     49  if ( the_extension == NULL ) {
    4450    _Objects_Allocator_unlock();
    4551    return RTEMS_TOO_MANY;
  • testsuites/sptests/sp07/init.c

    r80cf60e r3d73642  
    7474  Extension_name[ 2 ] =  rtems_build_name( 'E', 'X', 'T', '2' );
    7575
     76  puts  ( "rtems_extension_create - bad table -- RTEMS_INVALID_ADDRESS" );
     77  status = rtems_extension_create( 0xa5a5a5a5, NULL, &id );
     78  fatal_directive_status(
     79    status, RTEMS_INVALID_ADDRESS, "rtems_extension_create" );
     80
    7681  puts  ( "rtems_extension_create - bad id pointer -- RTEMS_INVALID_ADDRESS" );
    7782  status = rtems_extension_create( 0xa5a5a5a5, &Extensions, NULL );
Note: See TracChangeset for help on using the changeset viewer.