Browse Source

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 [email protected] (Thank you, Mark!!)
Noriko Hosoi 11 years ago
parent
commit
afc8b06f9e
2 changed files with 6 additions and 6 deletions
  1. 5 5
      ldap/servers/plugins/acl/acl.c
  2. 1 1
      ldap/servers/plugins/acl/aclparse.c

+ 5 - 5
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];
 
 				/* 

+ 1 - 1
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 );