summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/objectidtoname.c
diff options
context:
space:
mode:
authorJoel Sherrill <joel.sherrill@OARcorp.com>2008-06-04 23:05:37 +0000
committerJoel Sherrill <joel.sherrill@OARcorp.com>2008-06-04 23:05:37 +0000
commitd8d373a1f24624aa8098e182d49cd8b4af9eea72 (patch)
treeb02fef3e828d60ed03d0329488982b04c5cfc070 /cpukit/score/src/objectidtoname.c
parent2008-06-04 Joel Sherrill <joel.sherrill@OARcorp.com> (diff)
downloadrtems-d8d373a1f24624aa8098e182d49cd8b4af9eea72.tar.bz2
2008-06-04 Joel Sherrill <joel.sherrill@OARcorp.com>
* score/src/objectgetinfo.c, score/src/objectidtoname.c, score/src/threadget.c: Make sure the pointer to the API object table is valid before derefencing it.
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 );