diff options
author | Endi S. Dewata <edewata@redhat.com> | 2010-07-12 23:07:05 -0500 |
---|---|---|
committer | Noriko Hosoi <nhosoi@redhat.com> | 2010-08-19 13:00:48 -0700 |
commit | 956dc049368e79e179c26994a67f1590994647a7 (patch) | |
tree | 2b5e43d07f373c25b3c191ae6968f074428259be | |
parent | 3630638348d97e5c28fb2d5413b85f7d2949582e (diff) | |
download | ds-956dc049368e79e179c26994a67f1590994647a7.tar.gz ds-956dc049368e79e179c26994a67f1590994647a7.tar.xz ds-956dc049368e79e179c26994a67f1590994647a7.zip |
Bug 614511 - fix coverify Defect Type: Null pointer dereferences issues 11846 - 11891
https://bugzilla.redhat.com/show_bug.cgi?id=614511
Resolves: bug 614511
Bug description: Fix coverify Defect Type: Null pointer dereferences issues 11846 - 11891
description: Catch possible NULL pointer in cos_cache_query_attr().
-rw-r--r-- | ldap/servers/plugins/cos/cos_cache.c | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/ldap/servers/plugins/cos/cos_cache.c b/ldap/servers/plugins/cos/cos_cache.c index 89902f84..d2e9bf87 100644 --- a/ldap/servers/plugins/cos/cos_cache.c +++ b/ldap/servers/plugins/cos/cos_cache.c @@ -2383,9 +2383,9 @@ static int cos_cache_query_attr(cos_cache *ptheCache, vattr_context *context, Sl } /* is this entry a child of the target tree(s)? */ - do + while(hit == 0 && pTargetTree) { - if(pTargetTree) { + { int rc = 0; char *tval = NULL; size_t tlen = 0; @@ -2403,8 +2403,7 @@ static int cos_cache_query_attr(cos_cache *ptheCache, vattr_context *context, Sl pTargetTree->val = tval; } } - - if( pTargetTree->val == 0 || + if( pTargetTree->val == 0 || slapi_dn_issuffix(pDn, pTargetTree->val) != 0 || (views_api && views_entry_exists(views_api, pTargetTree->val, e)) /* might be in a view */ ) @@ -2529,7 +2528,7 @@ static int cos_cache_query_attr(cos_cache *ptheCache, vattr_context *context, Sl pTargetTree = pTargetTree->list.pNext; - } while(hit == 0 && pTargetTree); + } /* while(hit == 0 && pTargetTree) */ if(hit==0 || merge_mode) |