diff options
author | Ryan Long <ryan.long@oarcorp.com> | 2021-03-10 10:05:21 -0500 |
---|---|---|
committer | Joel Sherrill <joel@rtems.org> | 2021-04-29 09:48:00 -0500 |
commit | cdf66529fd2dcbedc27f0ac9ac2f3e4737ea4d0b (patch) | |
tree | 922076e47dcc911dc6e50f15779ee74800ecad80 /cpukit/score | |
parent | pwdgrp.c: Removed unused variable (diff) | |
download | rtems-cdf66529fd2dcbedc27f0ac9ac2f3e4737ea4d0b.tar.bz2 |
objectextendinformation.c: Ensure information->object_blocks is not NULL
CID 26033: Dereference after null check in _Objects_Extend_information().
Closes #4326
Diffstat (limited to 'cpukit/score')
-rw-r--r-- | cpukit/score/src/objectextendinformation.c | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/cpukit/score/src/objectextendinformation.c b/cpukit/score/src/objectextendinformation.c index 9796eb9e56..c6693016d4 100644 --- a/cpukit/score/src/objectextendinformation.c +++ b/cpukit/score/src/objectextendinformation.c @@ -171,6 +171,17 @@ Objects_Maximum _Objects_Extend_information( if ( old_maximum > extend_count ) { /* + * Coverity thinks there is a way for this to be NULL (CID #26033). + * After much time spent analyzing this, no one has identified the + * conditions where this can actually occur. Adding this _Assert ensures + * that it is never NULL. If this assert is triggered, condition + * generating this case will have been identified and it can be revisted. + * This is being done out of an abundance of caution since we could have + * easily flagged this as a false positive and ignored it completely. + */ + _Assert(information->object_blocks != NULL); + + /* * Copy each section of the table over. This has to be performed as * separate parts as size of each block has changed. */ |