Blame SOURCES/0055-Ticket-47965-Fix-coverity-issues-2014-12-16.patch

f92ce9
From c56a01740faa7af009eab4f009d334bb7b705f89 Mon Sep 17 00:00:00 2001
f92ce9
From: Noriko Hosoi <nhosoi@redhat.com>
f92ce9
Date: Tue, 16 Dec 2014 11:26:04 -0800
f92ce9
Subject: [PATCH 55/55] Ticket 47965 - Fix coverity issues (2014/12/16)
f92ce9
f92ce9
12867 - Uninitialized pointer read
f92ce9
f92ce9
Description:
f92ce9
The third arg for ldap_utf8strtok_r is supposed to be initialized.
f92ce9
f92ce9
https://fedorahosted.org/389/ticket/47965
f92ce9
f92ce9
Reviewed by mreynolds@redhat.com (Thank you, Mark!!)
f92ce9
f92ce9
(cherry picked from commit 62072539953d0956e0f2664ef1a3691cf8fbdac0)
f92ce9
(cherry picked from commit a2977b4b1839f4853594a46593ac5e2e27155bed)
f92ce9
---
f92ce9
 ldap/servers/plugins/acl/acllas.c                     | 6 +++---
f92ce9
 ldap/servers/plugins/acl/aclparse.c                   | 4 ++--
f92ce9
 ldap/servers/plugins/replication/repl5_replica.c      | 2 +-
f92ce9
 ldap/servers/plugins/replication/repl_extop.c         | 4 ++--
f92ce9
 ldap/servers/plugins/replication/windows_connection.c | 2 +-
f92ce9
 ldap/servers/plugins/replication/windows_private.c    | 2 +-
f92ce9
 ldap/servers/plugins/rootdn_access/rootdn_access.c    | 2 +-
f92ce9
 ldap/servers/slapd/back-ldbm/ldbm_attr.c              | 2 +-
f92ce9
 8 files changed, 12 insertions(+), 12 deletions(-)
f92ce9
f92ce9
diff --git a/ldap/servers/plugins/acl/acllas.c b/ldap/servers/plugins/acl/acllas.c
f92ce9
index 439c8f1..4738a40 100644
f92ce9
--- a/ldap/servers/plugins/acl/acllas.c
f92ce9
+++ b/ldap/servers/plugins/acl/acllas.c
f92ce9
@@ -1223,7 +1223,7 @@ DS_LASUserDnAttrEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator,
f92ce9
 	
f92ce9
 	/* See if we have a  parent[2].attr" rule */
f92ce9
 	if (strstr(attrName, "parent[") != NULL) {
f92ce9
-		char	*word, *str, *next;
f92ce9
+		char	*word, *str, *next = NULL;
f92ce9
 	
f92ce9
 		numOflevels = 0;
f92ce9
 		n_currEntryDn = slapi_entry_get_ndn ( lasinfo.resourceEntry );
f92ce9
@@ -1489,7 +1489,7 @@ DS_LASLdapUrlAttrEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator,
f92ce9
 
f92ce9
 	/* See if we have a  parent[2].attr" rule */
f92ce9
 	if (strstr(attrName, "parent[") != NULL) {
f92ce9
-		char	*word, *str, *next;
f92ce9
+		char	*word, *str, *next = NULL;
f92ce9
 	
f92ce9
 		numOflevels = 0;
f92ce9
 		n_currEntryDn = slapi_entry_get_ndn ( lasinfo.resourceEntry );
f92ce9
@@ -2659,7 +2659,7 @@ DS_LASGroupDnAttrEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator,
f92ce9
 
f92ce9
 		/* See if we have a  parent[2].attr" rule */
f92ce9
 		if (strstr(attrName, "parent[") != NULL) {
f92ce9
-			char	*word, *str, *next;
f92ce9
+			char	*word, *str, *next = NULL;
f92ce9
 
f92ce9
 			numOflevels = 0;
f92ce9
 			n_currEntryDn = slapi_entry_get_ndn ( lasinfo.resourceEntry ) ;
f92ce9
diff --git a/ldap/servers/plugins/acl/aclparse.c b/ldap/servers/plugins/acl/aclparse.c
f92ce9
index be86c8b..fd262e8 100644
f92ce9
--- a/ldap/servers/plugins/acl/aclparse.c
f92ce9
+++ b/ldap/servers/plugins/acl/aclparse.c
f92ce9
@@ -600,7 +600,7 @@ __aclp__sanity_check_acltxt (aci_t *aci_item, char *str)
f92ce9
 	ACLListHandle_t *handle = NULL;
f92ce9
 	char            *newstr = NULL;
f92ce9
 	char            *word;
f92ce9
-	char            *next;
f92ce9
+	char            *next = NULL;
f92ce9
 	const char      *brkstr = " ;";
f92ce9
 	int             checkversion = 0;
f92ce9
 
f92ce9
@@ -1367,7 +1367,7 @@ __aclp__get_aci_right (char *str)
f92ce9
 {
f92ce9
 
f92ce9
 	char	*sav_str = slapi_ch_strdup(str);
f92ce9
-	char	*t, *tt;
f92ce9
+	char	*t, *tt = NULL;
f92ce9
 	int   	type = 0;
f92ce9
 	char 	*delimiter = ",";
f92ce9
 	char 	*val = NULL;
f92ce9
diff --git a/ldap/servers/plugins/replication/repl5_replica.c b/ldap/servers/plugins/replication/repl5_replica.c
f92ce9
index 77663f6..61ae7ec 100644
f92ce9
--- a/ldap/servers/plugins/replication/repl5_replica.c
f92ce9
+++ b/ldap/servers/plugins/replication/repl5_replica.c
f92ce9
@@ -2046,7 +2046,7 @@ replica_check_for_tasks(Replica *r, Slapi_Entry *e)
f92ce9
         char *forcing;
f92ce9
         char *csnpart;
f92ce9
         char *ridstr;
f92ce9
-        char *iter;
f92ce9
+        char *iter = NULL;
f92ce9
         int i;
f92ce9
 
f92ce9
         for(i = 0; i < CLEANRIDSIZ && clean_vals[i]; i++){
f92ce9
diff --git a/ldap/servers/plugins/replication/repl_extop.c b/ldap/servers/plugins/replication/repl_extop.c
f92ce9
index 35014a9..4fefe9f 100644
f92ce9
--- a/ldap/servers/plugins/replication/repl_extop.c
f92ce9
+++ b/ldap/servers/plugins/replication/repl_extop.c
f92ce9
@@ -1463,7 +1463,7 @@ multimaster_extop_abort_cleanruv(Slapi_PBlock *pb)
f92ce9
 	char *repl_root;
f92ce9
 	char *payload = NULL;
f92ce9
 	char *certify_all;
f92ce9
-	char *iter;
f92ce9
+	char *iter = NULL;
f92ce9
 	int rc = LDAP_SUCCESS;
f92ce9
 
f92ce9
 	slapi_pblock_get(pb, SLAPI_EXT_OP_REQ_OID, &extop_oid);
f92ce9
@@ -1591,7 +1591,7 @@ multimaster_extop_cleanruv(Slapi_PBlock *pb)
f92ce9
 	char *force = NULL;
f92ce9
 	char *extop_oid;
f92ce9
 	char *repl_root;
f92ce9
-	char *iter;
f92ce9
+	char *iter = NULL;
f92ce9
 	int release_it = 0;
f92ce9
 	int rid = 0;
f92ce9
 	int rc = LDAP_OPERATIONS_ERROR;
f92ce9
diff --git a/ldap/servers/plugins/replication/windows_connection.c b/ldap/servers/plugins/replication/windows_connection.c
f92ce9
index c7c7a98..e78c367 100644
f92ce9
--- a/ldap/servers/plugins/replication/windows_connection.c
f92ce9
+++ b/ldap/servers/plugins/replication/windows_connection.c
f92ce9
@@ -595,7 +595,7 @@ windows_LDAPMessage2Entry(Slapi_Entry *e, Repl_Connection *conn,
f92ce9
 				char *dupa = slapi_ch_strdup(a);
f92ce9
 				char *newa = NULL; /* dup of 'a' with next range */
f92ce9
 				char *p, *wp, *pp; /* work pointers */
f92ce9
-				char *iter;
f92ce9
+				char *iter = NULL;
f92ce9
 				int high = 0;
f92ce9
 				int sizea = strlen(a) + 2;
f92ce9
 				/* handling subtype(s) */
f92ce9
diff --git a/ldap/servers/plugins/replication/windows_private.c b/ldap/servers/plugins/replication/windows_private.c
f92ce9
index cfa2704..9be6c7d 100644
f92ce9
--- a/ldap/servers/plugins/replication/windows_private.c
f92ce9
+++ b/ldap/servers/plugins/replication/windows_private.c
f92ce9
@@ -946,7 +946,7 @@ create_subtree_pairs(char **pairs)
f92ce9
 	subtreePair *spp;
f92ce9
 	char **ptr;
f92ce9
 	char *p0, *p1;
f92ce9
-	char *saveptr;
f92ce9
+	char *saveptr = NULL;
f92ce9
 	int cnt;
f92ce9
 
f92ce9
 	for (cnt = 0, ptr = pairs; ptr && *ptr; cnt++, ptr++) ;
f92ce9
diff --git a/ldap/servers/plugins/rootdn_access/rootdn_access.c b/ldap/servers/plugins/rootdn_access/rootdn_access.c
f92ce9
index 3045e9f..5c530c6 100644
f92ce9
--- a/ldap/servers/plugins/rootdn_access/rootdn_access.c
f92ce9
+++ b/ldap/servers/plugins/rootdn_access/rootdn_access.c
f92ce9
@@ -229,7 +229,7 @@ rootdn_load_config(Slapi_PBlock *pb)
f92ce9
     Slapi_Entry *e = NULL;
f92ce9
     char *openTime = NULL;
f92ce9
     char *closeTime = NULL;
f92ce9
-    char *token, *iter, *copy;
f92ce9
+    char *token, *iter = NULL, *copy;
f92ce9
     char hour[3], min[3];
f92ce9
     int result = 0;
f92ce9
     int time;
f92ce9
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_attr.c b/ldap/servers/slapd/back-ldbm/ldbm_attr.c
f92ce9
index 13ab07b..7b3f664 100644
f92ce9
--- a/ldap/servers/slapd/back-ldbm/ldbm_attr.c
f92ce9
+++ b/ldap/servers/slapd/back-ldbm/ldbm_attr.c
f92ce9
@@ -509,7 +509,7 @@ attr_index_parse_idlistsize(struct attrinfo *ai, const char *strval, struct inde
f92ce9
 	int rc = 0; /* assume success */
f92ce9
 	char *mystr = slapi_ch_strdup(strval); /* copy for strtok */
f92ce9
 	char *values = NULL;
f92ce9
-	char *lasts, *val, *ptr;
f92ce9
+	char *lasts = NULL, *val, *ptr;
f92ce9
 	int seen_limit = 0, seen_type = 0, seen_flags = 0, seen_values = 0;
f92ce9
 	Slapi_Attr *attr = &ai->ai_sattr;
f92ce9
 
f92ce9
-- 
f92ce9
1.9.3
f92ce9