mirror of
https://gitlab.rtems.org/rtems/rtos/rtems.git
synced 2026-09-20 10:58:16 +08:00
objectgetinfo.c: Add test case for API field too high
This was spotted by Coverity as CID 1592935. Closes #5076.
This commit is contained in:
@@ -66,6 +66,9 @@ Objects_Information *_Objects_Get_information(
|
||||
if ( !_Objects_Information_table[ the_api ] )
|
||||
return NULL;
|
||||
|
||||
if ( the_class > OBJECTS_APIS_LAST )
|
||||
return NULL;
|
||||
|
||||
info = _Objects_Information_table[ the_api ][ the_class ];
|
||||
if ( !info )
|
||||
return NULL;
|
||||
|
||||
@@ -378,8 +378,15 @@ rtems_task Init(
|
||||
);
|
||||
|
||||
puts( "rtems_object_get_class_information - INVALID_NUMBER (bad API)" );
|
||||
sc =
|
||||
rtems_object_get_class_information(0, OBJECTS_INTERNAL_THREADS, &info);
|
||||
sc = rtems_object_get_class_information(0, OBJECTS_INTERNAL_THREADS, &info);
|
||||
fatal_directive_status(
|
||||
sc,
|
||||
RTEMS_INVALID_NUMBER,
|
||||
"rtems_object_get_class_information (API)"
|
||||
);
|
||||
|
||||
puts( "rtems_object_get_class_information - INVALID_NUMBER (API too high)" );
|
||||
sc = rtems_object_get_class_information(0, 4, &info);
|
||||
fatal_directive_status(
|
||||
sc,
|
||||
RTEMS_INVALID_NUMBER,
|
||||
|
||||
@@ -5,6 +5,7 @@ rtems_object_get_classic_name - INVALID_ADDRESS
|
||||
rtems_object_get_classic_name - INVALID_ID (bad index)
|
||||
rtems_object_get_classic_name - INVALID_ID (unallocated index)
|
||||
rtems_object_get_classic_name - INVALID_ID (bad API)
|
||||
rtems_object_get_classic_name - INVALID_ID (API too high)
|
||||
UI1 - name returned by rtems_object_get_classic_name for Init task id
|
||||
UI1 - name returned by rtems_object_get_classic_name for RTEMS_SELF
|
||||
TEMP - rtems_build_name for TEMP
|
||||
|
||||
Reference in New Issue
Block a user