summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/objectidtoname.c
diff options
context:
space:
mode:
Diffstat (limited to 'cpukit/score/src/objectidtoname.c')
-rw-r--r--cpukit/score/src/objectidtoname.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/cpukit/score/src/objectidtoname.c b/cpukit/score/src/objectidtoname.c
index 52a4813815..de34dc5fa1 100644
--- a/cpukit/score/src/objectidtoname.c
+++ b/cpukit/score/src/objectidtoname.c
@@ -54,7 +54,10 @@ Objects_Name_or_id_lookup_errors _Objects_Id_to_name (
tmpId = (id == OBJECTS_ID_OF_SELF) ? _Thread_Executing->Object.id : id;
the_api = _Objects_Get_API( tmpId );
- if ( the_api && the_api > OBJECTS_APIS_LAST )
+ if ( !_Objects_Is_api_valid( the_api ) )
+ return OBJECTS_INVALID_ID;
+
+ if ( !_Objects_Information_table[ the_api ] )
return OBJECTS_INVALID_ID;
the_class = _Objects_Get_class( tmpId );