From 956dc049368e79e179c26994a67f1590994647a7 Mon Sep 17 00:00:00 2001 From: "Endi S. Dewata" Date: Mon, 12 Jul 2010 23:07:05 -0500 Subject: 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(). --- ldap/servers/plugins/cos/cos_cache.c | 9 ++++----- 1 file 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) -- cgit