summaryrefslogtreecommitdiffstats
path: root/cpukit/score/src/threadget.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/threadget.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/threadget.c')
-rw-r--r--cpukit/score/src/threadget.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/cpukit/score/src/threadget.c b/cpukit/score/src/threadget.c
index 126a6cc69f..d7d9106998 100644
--- a/cpukit/score/src/threadget.c
+++ b/cpukit/score/src/threadget.c
@@ -53,6 +53,7 @@ Thread_Control *_Thread_Get (
{
uint32_t the_api;
uint32_t the_class;
+ Objects_Information **api_information;
Objects_Information *information;
Thread_Control *tp = (Thread_Control *) 0;
@@ -75,7 +76,13 @@ Thread_Control *_Thread_Get (
goto done;
}
- information = _Objects_Information_table[ the_api ][ the_class ];
+ api_information = _Objects_Information_table[ the_api ];
+ if ( !api_information ) {
+ *location = OBJECTS_ERROR;
+ goto done;
+ }
+
+ information = api_information[ the_class ];
if ( !information ) {
*location = OBJECTS_ERROR;
goto done;