From afc8b06f9e9cc045906d6d6fb64fe5d5f9d7c3d5 Mon Sep 17 00:00:00 2001 From: Noriko Hosoi Date: Oct 01 2014 23:31:49 +0000 Subject: Ticket #47892 - coverity defects found in 1.3.3.x Description: fixing compiler warnings reported by covscan on 1.3.3.4. https://fedorahosted.org/389/ticket/47892#comment:8 Reviewed by mreynolds@redhat.com (Thank you, Mark!!) --- diff --git a/ldap/servers/plugins/acl/acl.c b/ldap/servers/plugins/acl/acl.c index f8b854c..fe863c8 100644 --- a/ldap/servers/plugins/acl/acl.c +++ b/ldap/servers/plugins/acl/acl.c @@ -2475,13 +2475,13 @@ acl__resource_match_aci( Acl_PBlock *aclpb, aci_t *aci, int skip_attrEval, int * int done; - if (aclpb->aclpb_access & SLAPI_ACL_ADD && - aci->aci_type & ACI_TARGET_ATTR_ADD_FILTERS) { + if ((aclpb->aclpb_access & SLAPI_ACL_ADD) && + (aci->aci_type & ACI_TARGET_ATTR_ADD_FILTERS)) { attrFilterArray = aci->targetAttrAddFilters; - } else if (aclpb->aclpb_access & SLAPI_ACL_DELETE && - aci->aci_type & ACI_TARGET_ATTR_DEL_FILTERS) { + } else if ((aclpb->aclpb_access & SLAPI_ACL_DELETE) && + (aci->aci_type & ACI_TARGET_ATTR_DEL_FILTERS)) { attrFilterArray = aci->targetAttrDelFilters; @@ -2490,7 +2490,7 @@ acl__resource_match_aci( Acl_PBlock *aclpb, aci_t *aci, int skip_attrEval, int * attr_matched = ACL_TRUE; num_attrs = 0; - while (attrFilterArray[num_attrs] && attr_matched) { + while (attrFilterArray && attrFilterArray[num_attrs] && attr_matched) { attrFilter = attrFilterArray[num_attrs]; /* diff --git a/ldap/servers/plugins/acl/aclparse.c b/ldap/servers/plugins/acl/aclparse.c index ae4f2d5..ea64fa7 100644 --- a/ldap/servers/plugins/acl/aclparse.c +++ b/ldap/servers/plugins/acl/aclparse.c @@ -256,7 +256,7 @@ __aclp__parse_aci(char *str, aci_t *aci_item, char **errbuf) int targetattrfilterslen = strlen(aci_targetattrfilters); int target_to_len = strlen(aci_target_to); int target_from_len = strlen(aci_target_from); - PRBool is_target_to; + PRBool is_target_to = PR_FALSE; __acl_strip_leading_space( &str );