andykimpe / rpms / 389-ds-base

Forked from rpms/389-ds-base 6 months ago
Clone

Blame SOURCES/0015-Ticket-47892-coverity-defects-found-in-1.3.3.x.patch

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