Changeset 17bbadd in rtems


Ignore:
Timestamp:
05/06/04 19:20:04 (19 years ago)
Author:
Joel Sherrill <joel.sherrill@…>
Children:
df54012
Parents:
424f2e40
Message:

2004-05-06 Joel Sherrill <joel@…>

PR 618/rtems

  • include/rtems/rtems/status.h, src/clockget.c, src/clockset.c, src/dpmemcreate.c, src/dpmemexternal2internal.c, src/dpmeminternal2external.c, src/eventmp.c, src/eventreceive.c, src/eventsend.c, src/msgqbroadcast.c, src/msgqcreate.c, src/msgqflush.c, src/msgqgetnumberpending.c, src/msgqreceive.c, src/msgqsubmit.c, src/partcreate.c, src/partdelete.c, src/partgetbuffer.c, src/ratemoncancel.c, src/ratemoncreate.c, src/ratemondelete.c, src/ratemongetstatus.c, src/ratemonident.c, src/ratemonperiod.c, src/regioncreate.c, src/regiondelete.c, src/regionextend.c, src/regiongetsegment.c, src/regiongetsegmentsize.c, src/regionreturnsegment.c, src/semcreate.c, src/semdelete.c, src/semflush.c, src/semident.c, src/taskcreate.c, src/taskgetnote.c, src/taskmode.c, src/taskrestart.c, src/taskresume.c, src/tasksetnote.c, src/tasksuspend.c, src/taskvariableadd.c, src/taskvariabledelete.c, src/taskvariableget.c, src/taskwakewhen.c, src/timercreate.c, src/timerdelete.c, src/timerfireafter.c, src/timerfirewhen.c, src/timerserverfireafter.c, src/timerserverfirewhen.c: Add NULL checks.
Location:
cpukit/rtems
Files:
52 edited

Legend:

Unmodified
Added
Removed
  • cpukit/rtems/ChangeLog

    r424f2e40 r17bbadd  
     12004-05-06      Joel Sherrill <joel@OARcorp.com>
     2
     3        PR 618/rtems
     4        * include/rtems/rtems/status.h, src/clockget.c, src/clockset.c,
     5        src/dpmemcreate.c, src/dpmemexternal2internal.c,
     6        src/dpmeminternal2external.c, src/eventmp.c, src/eventreceive.c,
     7        src/eventsend.c, src/msgqbroadcast.c, src/msgqcreate.c,
     8        src/msgqflush.c, src/msgqgetnumberpending.c, src/msgqreceive.c,
     9        src/msgqsubmit.c, src/partcreate.c, src/partdelete.c,
     10        src/partgetbuffer.c, src/ratemoncancel.c, src/ratemoncreate.c,
     11        src/ratemondelete.c, src/ratemongetstatus.c, src/ratemonident.c,
     12        src/ratemonperiod.c, src/regioncreate.c, src/regiondelete.c,
     13        src/regionextend.c, src/regiongetsegment.c,
     14        src/regiongetsegmentsize.c, src/regionreturnsegment.c,
     15        src/semcreate.c, src/semdelete.c, src/semflush.c, src/semident.c,
     16        src/taskcreate.c, src/taskgetnote.c, src/taskmode.c,
     17        src/taskrestart.c, src/taskresume.c, src/tasksetnote.c,
     18        src/tasksuspend.c, src/taskvariableadd.c, src/taskvariabledelete.c,
     19        src/taskvariableget.c, src/taskwakewhen.c, src/timercreate.c,
     20        src/timerdelete.c, src/timerfireafter.c, src/timerfirewhen.c,
     21        src/timerserverfireafter.c, src/timerserverfirewhen.c: Add NULL
     22        checks.
     23
    1242004-02-26      Thomas Rauscher <trauscher@loytec.com.
    225
  • cpukit/rtems/include/rtems/rtems/status.h

    r424f2e40 r17bbadd  
    6666  RTEMS_SUCCESSFUL,      /* OBJECTS_SUCCESSFUL */
    6767  RTEMS_INVALID_NAME,    /* OBJECTS_INVALID_NAME */
     68  RTEMS_INVALID_ADDRESS, /* OBJECTS_INVALID_ADDRESS */
    6869  RTEMS_INVALID_NODE     /* OBJECTS_INVALID_NODE */
    6970};
  • cpukit/rtems/src/clockget.c

    r424f2e40 r17bbadd  
    4646  rtems_interval tmp;
    4747
     48   if ( !time_buffer )
     49     return RTEMS_INVALID_ADDRESS;
     50
    4851  switch ( option ) {
    4952    case RTEMS_CLOCK_GET_TOD:
  • cpukit/rtems/src/clockset.c

    r424f2e40 r17bbadd  
    4040  rtems_interval     seconds;
    4141
     42  if ( !time_buffer )
     43    return RTEMS_INVALID_ADDRESS;
     44
    4245  if ( _TOD_Validate( time_buffer ) ) {
    4346    seconds = _TOD_To_seconds( time_buffer );
  • cpukit/rtems/src/dpmemcreate.c

    r424f2e40 r17bbadd  
    5353    return RTEMS_INVALID_NAME;
    5454
     55  if ( !id )
     56    return RTEMS_INVALID_ADDRESS;
     57
    5558  if ( !_Addresses_Is_aligned( internal_start ) ||
    5659       !_Addresses_Is_aligned( external_start ) )
  • cpukit/rtems/src/dpmemexternal2internal.c

    r424f2e40 r17bbadd  
    5050  unsigned32                           ending;
    5151
     52  if ( !internal )
     53    return RTEMS_INVALID_ADDRESS;
     54
    5255  the_port = _Dual_ported_memory_Get( id, &location );
    5356  switch ( location ) {
  • cpukit/rtems/src/dpmeminternal2external.c

    r424f2e40 r17bbadd  
    5050  unsigned32                           ending;
    5151
     52  if ( !external )
     53    return RTEMS_INVALID_ADDRESS;
     54
    5255  the_port = _Dual_ported_memory_Get( id, &location );
    5356  switch ( location ) {
  • cpukit/rtems/src/eventmp.c

    r424f2e40 r17bbadd  
    4141  Event_MP_Remote_operations operation,
    4242  Objects_Id                 event_id,
    43   rtems_event_set         event_in
     43  rtems_event_set            event_in
    4444)
    4545{
  • cpukit/rtems/src/eventreceive.c

    r424f2e40 r17bbadd  
    4949  RTEMS_API_Control       *api;
    5050
     51  if ( !event_out )
     52    return RTEMS_INVALID_ADDRESS;
     53
    5154  api = _Thread_Executing->API_Extensions[ THREAD_API_RTEMS ];
    5255
  • cpukit/rtems/src/eventsend.c

    r424f2e40 r17bbadd  
    3838
    3939rtems_status_code rtems_event_send(
    40   Objects_Id         id,
    41   rtems_event_set event_in
     40  Objects_Id        id,
     41  rtems_event_set   event_in
    4242)
    4343{
  • cpukit/rtems/src/msgqbroadcast.c

    r424f2e40 r17bbadd  
    6161  CORE_message_queue_Status       core_status;
    6262
     63  if ( !buffer )
     64    return RTEMS_INVALID_ADDRESS;
     65
     66  if ( !count )
     67    return RTEMS_INVALID_ADDRESS;
     68
    6369  the_message_queue = _Message_queue_Get( id, &location );
    6470  switch ( location ) {
  • cpukit/rtems/src/msgqcreate.c

    r424f2e40 r17bbadd  
    6767  if ( !rtems_is_name_valid( name ) )
    6868    return RTEMS_INVALID_NAME;
     69
     70  if ( !id )
     71    return RTEMS_INVALID_ADDRESS;
    6972
    7073#if defined(RTEMS_MULTIPROCESSING)
  • cpukit/rtems/src/msgqflush.c

    r424f2e40 r17bbadd  
    5757  Objects_Locations               location;
    5858
     59  if ( !count )
     60    return RTEMS_INVALID_ADDRESS;
     61
    5962  the_message_queue = _Message_queue_Get( id, &location );
    6063  switch ( location ) {
  • cpukit/rtems/src/msgqgetnumberpending.c

    r424f2e40 r17bbadd  
    5555  Objects_Locations               location;
    5656
     57  if ( !count )
     58    return RTEMS_INVALID_ADDRESS;
     59
    5760  the_message_queue = _Message_queue_Get( id, &location );
    5861  switch ( location ) {
  • cpukit/rtems/src/msgqreceive.c

    r424f2e40 r17bbadd  
    6262  boolean                         wait;
    6363 
     64  if ( !buffer )
     65    return RTEMS_INVALID_ADDRESS;
     66
     67  if ( !size )
     68    return RTEMS_INVALID_ADDRESS;
     69
    6470  the_message_queue = _Message_queue_Get( id, &location );
    6571  switch ( location ) {
  • cpukit/rtems/src/msgqsubmit.c

    r424f2e40 r17bbadd  
    6969  Objects_Locations                location;
    7070  CORE_message_queue_Status        msg_status;
     71
     72  if ( !buffer )
     73    return RTEMS_INVALID_ADDRESS;
    7174
    7275  the_message_queue = _Message_queue_Get( id, &location );
  • cpukit/rtems/src/partcreate.c

    r424f2e40 r17bbadd  
    4848  unsigned32          length,
    4949  unsigned32          buffer_size,
    50   rtems_attribute  attribute_set,
     50  rtems_attribute     attribute_set,
    5151  Objects_Id         *id
    5252)
     
    5656  if ( !rtems_is_name_valid( name ) )
    5757    return RTEMS_INVALID_NAME;
     58
     59  if ( !starting_address )
     60    return RTEMS_INVALID_ADDRESS;
     61
     62  if ( !id )
     63    return RTEMS_INVALID_ADDRESS;
    5864
    5965  if ( length == 0 || buffer_size == 0 || length < buffer_size ||
  • cpukit/rtems/src/partdelete.c

    r424f2e40 r17bbadd  
    3535 *  Output parameters:
    3636 *    RTEMS_SUCCESSFUL - if successful
    37  *    error code        - if unsuccessful
     37 *    error code       - if unsuccessful
    3838 */
    3939
     
    4343{
    4444  register Partition_Control *the_partition;
    45   Objects_Locations                  location;
     45  Objects_Locations           location;
    4646
    4747  the_partition = _Partition_Get( id, &location );
  • cpukit/rtems/src/partgetbuffer.c

    r424f2e40 r17bbadd  
    4747  void                       *the_buffer;
    4848
     49  if ( !buffer )
     50    return RTEMS_INVALID_ADDRESS;
     51
    4952  the_partition = _Partition_Get( id, &location );
    5053  switch ( location ) {
  • cpukit/rtems/src/ratemoncancel.c

    r424f2e40 r17bbadd  
    3232 *  Output parameters:
    3333 *    RTEMS_SUCCESSFUL - if successful and caller is not the owning thread
    34  *    error code        - if unsuccessful
     34 *    error code       - if unsuccessful
    3535 */
    3636
     
    4040{
    4141  Rate_monotonic_Control *the_period;
    42   Objects_Locations              location;
     42  Objects_Locations       location;
    4343
    4444  the_period = _Rate_monotonic_Get( id, &location );
  • cpukit/rtems/src/ratemoncreate.c

    r424f2e40 r17bbadd  
    3333 *
    3434 *  Output parameters:
    35  *    id                - rate monotonic id
     35 *    id               - rate monotonic id
    3636 *    RTEMS_SUCCESSFUL - if successful
    37  *    error code        - if unsuccessful
     37 *    error code       - if unsuccessful
    3838 */
    3939
     
    4747  if ( !rtems_is_name_valid( name ) )
    4848    return RTEMS_INVALID_NAME;
     49
     50  if ( !id )
     51    return RTEMS_INVALID_ADDRESS;
    4952
    5053  _Thread_Disable_dispatch();            /* to prevent deletion */
  • cpukit/rtems/src/ratemondelete.c

    r424f2e40 r17bbadd  
    3232 *  Output parameters:
    3333 *    RTEMS_SUCCESSFUL - if successful
    34  *    error code        - if unsuccessful
     34 *    error code       - if unsuccessful
    3535 */
    3636
     
    4040{
    4141  Rate_monotonic_Control *the_period;
    42   Objects_Locations              location;
     42  Objects_Locations       location;
    4343
    4444  the_period = _Rate_monotonic_Get( id, &location );
  • cpukit/rtems/src/ratemongetstatus.c

    r424f2e40 r17bbadd  
    4646  Rate_monotonic_Control        *the_period;
    4747
    48   if ( status == NULL )
     48  if ( !status )
    4949    return RTEMS_INVALID_ADDRESS;
    5050
  • cpukit/rtems/src/ratemonident.c

    r424f2e40 r17bbadd  
    3333 *
    3434 *  Output parameters:
    35  *    *id               - region id
     35 *    *id              - region id
    3636 *    RTEMS_SUCCESSFUL - if successful
    37  *    error code        - if unsuccessful
     37 *    error code       - if unsuccessful
    3838 */
    3939
  • cpukit/rtems/src/ratemonperiod.c

    r424f2e40 r17bbadd  
    3333 *  Output parameters:
    3434 *    RTEMS_SUCCESSFUL - if successful
    35  *    error code        - if unsuccessful
     35 *    error code       - if unsuccessful
    3636 */
    3737
  • cpukit/rtems/src/regioncreate.c

    r424f2e40 r17bbadd  
    4949  unsigned32          length,
    5050  unsigned32          page_size,
    51   rtems_attribute  attribute_set,
     51  rtems_attribute     attribute_set,
    5252  Objects_Id         *id
    5353)
     
    5757  if ( !rtems_is_name_valid( name ) )
    5858    return RTEMS_INVALID_NAME;
     59
     60  if ( !starting_address )
     61    return RTEMS_INVALID_ADDRESS;
     62
     63  if ( !id )
     64    return RTEMS_INVALID_ADDRESS;
    5965
    6066  if ( !_Addresses_Is_aligned( starting_address ) )
  • cpukit/rtems/src/regiondelete.c

    r424f2e40 r17bbadd  
    3636 *  Output parameters:
    3737 *    RTEMS_SUCCESSFUL - if successful
    38  *    error code - if unsuccessful
     38 *    error code       - if unsuccessful
    3939 */
    4040
     
    4444{
    4545  register Region_Control *the_region;
    46   Objects_Locations               location;
     46  Objects_Locations        location;
    4747
    4848  _RTEMS_Lock_allocator();
  • cpukit/rtems/src/regionextend.c

    r424f2e40 r17bbadd  
    5252  rtems_status_code   status;
    5353
     54  if ( !starting_address )
     55    return RTEMS_INVALID_ADDRESS;
     56
    5457  status = RTEMS_SUCCESSFUL;
    5558
  • cpukit/rtems/src/regiongetsegment.c

    r424f2e40 r17bbadd  
    5454  Thread_Control          *executing;
    5555  void                    *the_segment;
     56
     57  if ( !segment )
     58    return RTEMS_INVALID_ADDRESS;
    5659
    5760  *segment = NULL;
  • cpukit/rtems/src/regiongetsegmentsize.c

    r424f2e40 r17bbadd  
    5050  Thread_Control          *executing;
    5151
     52  if ( !segment )
     53    return RTEMS_INVALID_ADDRESS;
     54
     55  if ( !size )
     56    return RTEMS_INVALID_ADDRESS;
     57
    5258  _RTEMS_Lock_allocator();
    5359  executing  = _Thread_Executing;
  • cpukit/rtems/src/regionreturnsegment.c

    r424f2e40 r17bbadd  
    4343 *  Output parameters:
    4444 *    RTEMS_SUCCESSFUL - if successful
    45  *    error code        - if unsuccessful
     45 *    error code       - if unsuccessful
    4646 */
    4747
  • cpukit/rtems/src/semcreate.c

    r424f2e40 r17bbadd  
    8181  if ( !rtems_is_name_valid( name ) )
    8282    return RTEMS_INVALID_NAME;
     83
     84  if ( !id )
     85    return RTEMS_INVALID_ADDRESS;
    8386
    8487#if defined(RTEMS_MULTIPROCESSING)
  • cpukit/rtems/src/semdelete.c

    r424f2e40 r17bbadd  
    5959 *  Output parameters:
    6060 *    RTEMS_SUCCESSFUL - if successful
    61  *    error code        - if unsuccessful
     61 *    error code       - if unsuccessful
    6262 */
    6363
  • cpukit/rtems/src/semflush.c

    r424f2e40 r17bbadd  
    4949 *  Output parameters:
    5050 *    RTEMS_SUCCESSFUL - if successful
    51  *    error code        - if unsuccessful
     51 *    error code       - if unsuccessful
    5252 */
    5353
  • cpukit/rtems/src/semident.c

    r424f2e40 r17bbadd  
    5959 *
    6060 *  Output parameters:
    61  *    *id      - semaphore id
     61 *    *id              - semaphore id
    6262 *    RTEMS_SUCCESSFUL - if successful
    63  *    error code - if unsuccessful
     63 *    error code       - if unsuccessful
    6464 */
    6565
  • cpukit/rtems/src/taskcreate.c

    r424f2e40 r17bbadd  
    7676    return RTEMS_INVALID_NAME;
    7777
     78  if ( !id )
     79    return RTEMS_INVALID_ADDRESS;
     80
    7881  /*
    7982   *  Core Thread Initialize insures we get the minimum amount of
  • cpukit/rtems/src/taskgetnote.c

    r424f2e40 r17bbadd  
    4242 *
    4343 *  Output parameters:
    44  *    note              - filled in if successful
     44 *    note             - filled in if successful
    4545 *    RTEMS_SUCCESSFUL - if successful
    46  *    error code        - if unsuccessful
     46 *    error code       - if unsuccessful
    4747 */
    4848
     
    5656  Objects_Locations        location;
    5757  RTEMS_API_Control       *api;
     58
     59  if ( !note )
     60    return RTEMS_INVALID_ADDRESS;
    5861
    5962  /*
  • cpukit/rtems/src/taskmode.c

    r424f2e40 r17bbadd  
    5858  boolean             needs_asr_dispatching = FALSE;
    5959  rtems_mode          old_mode;
     60
     61  if ( !previous_mode_set )
     62    return RTEMS_INVALID_ADDRESS;
    6063
    6164  executing     = _Thread_Executing;
  • cpukit/rtems/src/taskrestart.c

    r424f2e40 r17bbadd  
    4444 *  Output parameters:
    4545 *    RTEMS_SUCCESSFUL - if successful
    46  *    error code        - if unsuccessful
     46 *    error code       - if unsuccessful
    4747 */
    4848
  • cpukit/rtems/src/taskresume.c

    r424f2e40 r17bbadd  
    4141 *  Output parameters:
    4242 *    RTEMS_SUCCESSFUL - if successful
    43  *    error code        - if unsuccessful
     43 *    error code       - if unsuccessful
    4444 */
    4545
  • cpukit/rtems/src/tasksetnote.c

    r424f2e40 r17bbadd  
    4343 *  Output parameters:
    4444 *    RTEMS_SUCCESSFUL - if successful
    45  *    error code        - if unsuccessful
     45 *    error code       - if unsuccessful
    4646 */
    4747
  • cpukit/rtems/src/tasksuspend.c

    r424f2e40 r17bbadd  
    5050{
    5151  register Thread_Control *the_thread;
    52   Objects_Locations               location;
     52  Objects_Locations        location;
    5353
    5454  the_thread = _Thread_Get( id, &location );
  • cpukit/rtems/src/taskvariableadd.c

    r424f2e40 r17bbadd  
    3232  Objects_Locations      location;
    3333  rtems_task_variable_t *tvp, *new;
     34
     35  if ( !ptr )
     36    return RTEMS_INVALID_ADDRESS;
    3437
    3538  the_thread = _Thread_Get (tid, &location);
  • cpukit/rtems/src/taskvariabledelete.c

    r424f2e40 r17bbadd  
    3131  Objects_Locations      location;
    3232  rtems_task_variable_t *tvp, *prev;
     33
     34  if ( !ptr )
     35    return RTEMS_INVALID_ADDRESS;
    3336
    3437  prev = NULL;
  • cpukit/rtems/src/taskvariableget.c

    r424f2e40 r17bbadd  
    3232  Objects_Locations      location;
    3333  rtems_task_variable_t *tvp;
     34
     35  if ( !ptr )
     36    return RTEMS_INVALID_ADDRESS;
     37
     38  if ( !result )
     39    return RTEMS_INVALID_ADDRESS;
    3440
    3541  the_thread = _Thread_Get (tid, &location);
  • cpukit/rtems/src/taskwakewhen.c

    r424f2e40 r17bbadd  
    4141 *  Output parameters:
    4242 *    RTEMS_SUCCESSFUL - if successful
    43  *    error code        - if unsuccessful
     43 *    error code       - if unsuccessful
    4444 */
    4545
    4646rtems_status_code rtems_task_wake_when(
    47 rtems_time_of_day *time_buffer
     47  rtems_time_of_day *time_buffer
    4848)
    4949{
     
    5252  if ( !_TOD_Is_set )
    5353    return RTEMS_NOT_DEFINED;
     54
     55  if ( !time_buffer )
     56    return RTEMS_INVALID_ADDRESS;
    5457
    5558  time_buffer->ticks = 0;
  • cpukit/rtems/src/timercreate.c

    r424f2e40 r17bbadd  
    4848    return RTEMS_INVALID_NAME;
    4949
     50  if ( !id )
     51    return RTEMS_INVALID_ADDRESS;
     52
    5053  _Thread_Disable_dispatch();         /* to prevent deletion */
    5154
  • cpukit/rtems/src/timerdelete.c

    r424f2e40 r17bbadd  
    4040)
    4141{
    42   Timer_Control   *the_timer;
    43   Objects_Locations       location;
     42  Timer_Control     *the_timer;
     43  Objects_Locations  location;
    4444
    4545  the_timer = _Timer_Get( id, &location );
  • cpukit/rtems/src/timerfireafter.c

    r424f2e40 r17bbadd  
    5252    return RTEMS_INVALID_NUMBER;
    5353
     54  if ( !routine )
     55    return RTEMS_INVALID_ADDRESS;
     56
    5457  the_timer = _Timer_Get( id, &location );
    5558  switch ( location ) {
  • cpukit/rtems/src/timerfirewhen.c

    r424f2e40 r17bbadd  
    5656    return RTEMS_INVALID_CLOCK;
    5757
     58  if ( !routine )
     59    return RTEMS_INVALID_ADDRESS;
     60
    5861  seconds = _TOD_To_seconds( wall_time );
    5962  if ( seconds <= _TOD_Seconds_since_epoch )
  • cpukit/rtems/src/timerserverfireafter.c

    r424f2e40 r17bbadd  
    5454    return RTEMS_INCORRECT_STATE;
    5555
     56  if ( !routine )
     57    return RTEMS_INVALID_ADDRESS;
     58
    5659  if ( ticks == 0 )
    5760    return RTEMS_INVALID_NUMBER;
  • cpukit/rtems/src/timerserverfirewhen.c

    r424f2e40 r17bbadd  
    5858    return RTEMS_NOT_DEFINED;
    5959
     60  if ( !routine )
     61    return RTEMS_INVALID_ADDRESS;
     62
    6063  if ( !_TOD_Validate( wall_time ) )
    6164    return RTEMS_INVALID_CLOCK;
Note: See TracChangeset for help on using the changeset viewer.