|
|
dc8c34 |
From a50bbff2f4f41abb752b6f75ea3c3b77886611ce Mon Sep 17 00:00:00 2001
|
|
|
dc8c34 |
From: Noriko Hosoi <nhosoi@redhat.com>
|
|
|
dc8c34 |
Date: Tue, 16 Dec 2014 11:26:04 -0800
|
|
|
dc8c34 |
Subject: [PATCH 283/305] Ticket 47965 - Fix coverity issues (2014/12/16)
|
|
|
dc8c34 |
|
|
|
dc8c34 |
12867 - Uninitialized pointer read
|
|
|
dc8c34 |
|
|
|
dc8c34 |
Description:
|
|
|
dc8c34 |
The third arg for ldap_utf8strtok_r is supposed to be initialized.
|
|
|
dc8c34 |
|
|
|
dc8c34 |
https://fedorahosted.org/389/ticket/47965
|
|
|
dc8c34 |
|
|
|
dc8c34 |
Reviewed by mreynolds@redhat.com (Thank you, Mark!!)
|
|
|
dc8c34 |
|
|
|
dc8c34 |
(cherry picked from commit 62072539953d0956e0f2664ef1a3691cf8fbdac0)
|
|
|
dc8c34 |
(cherry picked from commit a2977b4b1839f4853594a46593ac5e2e27155bed)
|
|
|
dc8c34 |
(cherry picked from commit 9793fc437a75cca804be7cbec1def59c156f79c1)
|
|
|
dc8c34 |
|
|
|
dc8c34 |
Conflicts:
|
|
|
dc8c34 |
ldap/servers/plugins/acl/aclparse.c
|
|
|
dc8c34 |
ldap/servers/plugins/replication/windows_connection.c
|
|
|
dc8c34 |
ldap/servers/plugins/replication/windows_private.c
|
|
|
dc8c34 |
|
|
|
dc8c34 |
(cherry picked from commit 3d69f154192244de2b08b26ea09981cd3f02eecb)
|
|
|
dc8c34 |
---
|
|
|
dc8c34 |
ldap/servers/plugins/acl/acllas.c | 6 +++---
|
|
|
dc8c34 |
ldap/servers/plugins/acl/aclparse.c | 3 ++-
|
|
|
dc8c34 |
ldap/servers/plugins/replication/repl5_replica.c | 2 +-
|
|
|
dc8c34 |
ldap/servers/plugins/replication/repl_extop.c | 4 ++--
|
|
|
dc8c34 |
ldap/servers/plugins/rootdn_access/rootdn_access.c | 2 +-
|
|
|
dc8c34 |
ldap/servers/slapd/back-ldbm/ldbm_attr.c | 2 +-
|
|
|
dc8c34 |
6 files changed, 10 insertions(+), 9 deletions(-)
|
|
|
dc8c34 |
|
|
|
dc8c34 |
diff --git a/ldap/servers/plugins/acl/acllas.c b/ldap/servers/plugins/acl/acllas.c
|
|
|
dc8c34 |
index 3fb5d79..fc7f185 100644
|
|
|
dc8c34 |
--- a/ldap/servers/plugins/acl/acllas.c
|
|
|
dc8c34 |
+++ b/ldap/servers/plugins/acl/acllas.c
|
|
|
dc8c34 |
@@ -1212,7 +1212,7 @@ DS_LASUserDnAttrEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator,
|
|
|
dc8c34 |
|
|
|
dc8c34 |
/* See if we have a parent[2].attr" rule */
|
|
|
dc8c34 |
if (strstr(attrName, "parent[") != NULL) {
|
|
|
dc8c34 |
- char *word, *str, *next;
|
|
|
dc8c34 |
+ char *word, *str, *next = NULL;
|
|
|
dc8c34 |
|
|
|
dc8c34 |
numOflevels = 0;
|
|
|
dc8c34 |
n_currEntryDn = slapi_entry_get_ndn ( lasinfo.resourceEntry );
|
|
|
dc8c34 |
@@ -1458,7 +1458,7 @@ DS_LASLdapUrlAttrEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator,
|
|
|
dc8c34 |
|
|
|
dc8c34 |
/* See if we have a parent[2].attr" rule */
|
|
|
dc8c34 |
if (strstr(attrName, "parent[") != NULL) {
|
|
|
dc8c34 |
- char *word, *str, *next;
|
|
|
dc8c34 |
+ char *word, *str, *next = NULL;
|
|
|
dc8c34 |
|
|
|
dc8c34 |
numOflevels = 0;
|
|
|
dc8c34 |
n_currEntryDn = slapi_entry_get_ndn ( lasinfo.resourceEntry );
|
|
|
dc8c34 |
@@ -2626,7 +2626,7 @@ DS_LASGroupDnAttrEval(NSErr_t *errp, char *attr_name, CmpOp_t comparator,
|
|
|
dc8c34 |
|
|
|
dc8c34 |
/* See if we have a parent[2].attr" rule */
|
|
|
dc8c34 |
if (strstr(attrName, "parent[") != NULL) {
|
|
|
dc8c34 |
- char *word, *str, *next;
|
|
|
dc8c34 |
+ char *word, *str, *next = NULL;
|
|
|
dc8c34 |
|
|
|
dc8c34 |
numOflevels = 0;
|
|
|
dc8c34 |
n_currEntryDn = slapi_entry_get_ndn ( lasinfo.resourceEntry ) ;
|
|
|
dc8c34 |
diff --git a/ldap/servers/plugins/acl/aclparse.c b/ldap/servers/plugins/acl/aclparse.c
|
|
|
dc8c34 |
index 26d57c4..098b5f7 100644
|
|
|
dc8c34 |
--- a/ldap/servers/plugins/acl/aclparse.c
|
|
|
dc8c34 |
+++ b/ldap/servers/plugins/acl/aclparse.c
|
|
|
dc8c34 |
@@ -484,6 +484,7 @@ __aclp__sanity_check_acltxt (aci_t *aci_item, char *str)
|
|
|
dc8c34 |
}
|
|
|
dc8c34 |
|
|
|
dc8c34 |
newstr = slapi_ch_strdup (str);
|
|
|
dc8c34 |
+ next = NULL;
|
|
|
dc8c34 |
word = ldap_utf8strtok_r(newstr, " ", &next;;
|
|
|
dc8c34 |
if (strcasecmp (word, "version") == 0) {
|
|
|
dc8c34 |
word = ldap_utf8strtok_r(NULL, " ", &next;;
|
|
|
dc8c34 |
@@ -1189,7 +1190,7 @@ __aclp__get_aci_right (char *str)
|
|
|
dc8c34 |
{
|
|
|
dc8c34 |
|
|
|
dc8c34 |
char *sav_str = slapi_ch_strdup(str);
|
|
|
dc8c34 |
- char *t, *tt;
|
|
|
dc8c34 |
+ char *t, *tt = NULL;
|
|
|
dc8c34 |
int type = 0;
|
|
|
dc8c34 |
char *delimiter = ",";
|
|
|
dc8c34 |
char *val = NULL;
|
|
|
dc8c34 |
diff --git a/ldap/servers/plugins/replication/repl5_replica.c b/ldap/servers/plugins/replication/repl5_replica.c
|
|
|
dc8c34 |
index 3cc5cbb..f64e719 100644
|
|
|
dc8c34 |
--- a/ldap/servers/plugins/replication/repl5_replica.c
|
|
|
dc8c34 |
+++ b/ldap/servers/plugins/replication/repl5_replica.c
|
|
|
dc8c34 |
@@ -1837,7 +1837,7 @@ replica_check_for_tasks(Replica *r, Slapi_Entry *e)
|
|
|
dc8c34 |
char *forcing;
|
|
|
dc8c34 |
char *csnpart;
|
|
|
dc8c34 |
char *ridstr;
|
|
|
dc8c34 |
- char *iter;
|
|
|
dc8c34 |
+ char *iter = NULL;
|
|
|
dc8c34 |
int i;
|
|
|
dc8c34 |
|
|
|
dc8c34 |
for(i = 0; i < CLEANRIDSIZ && clean_vals[i]; i++){
|
|
|
dc8c34 |
diff --git a/ldap/servers/plugins/replication/repl_extop.c b/ldap/servers/plugins/replication/repl_extop.c
|
|
|
dc8c34 |
index 92207df..15e9758 100644
|
|
|
dc8c34 |
--- a/ldap/servers/plugins/replication/repl_extop.c
|
|
|
dc8c34 |
+++ b/ldap/servers/plugins/replication/repl_extop.c
|
|
|
dc8c34 |
@@ -1461,7 +1461,7 @@ multimaster_extop_abort_cleanruv(Slapi_PBlock *pb)
|
|
|
dc8c34 |
char *repl_root;
|
|
|
dc8c34 |
char *payload = NULL;
|
|
|
dc8c34 |
char *certify_all;
|
|
|
dc8c34 |
- char *iter;
|
|
|
dc8c34 |
+ char *iter = NULL;
|
|
|
dc8c34 |
int rc = LDAP_SUCCESS;
|
|
|
dc8c34 |
|
|
|
dc8c34 |
slapi_pblock_get(pb, SLAPI_EXT_OP_REQ_OID, &extop_oid);
|
|
|
dc8c34 |
@@ -1589,7 +1589,7 @@ multimaster_extop_cleanruv(Slapi_PBlock *pb)
|
|
|
dc8c34 |
char *force = NULL;
|
|
|
dc8c34 |
char *extop_oid;
|
|
|
dc8c34 |
char *repl_root;
|
|
|
dc8c34 |
- char *iter;
|
|
|
dc8c34 |
+ char *iter = NULL;
|
|
|
dc8c34 |
int release_it = 0;
|
|
|
dc8c34 |
int rid = 0;
|
|
|
dc8c34 |
int rc = LDAP_OPERATIONS_ERROR;
|
|
|
dc8c34 |
diff --git a/ldap/servers/plugins/rootdn_access/rootdn_access.c b/ldap/servers/plugins/rootdn_access/rootdn_access.c
|
|
|
dc8c34 |
index ad1e125..b2596c1 100644
|
|
|
dc8c34 |
--- a/ldap/servers/plugins/rootdn_access/rootdn_access.c
|
|
|
dc8c34 |
+++ b/ldap/servers/plugins/rootdn_access/rootdn_access.c
|
|
|
dc8c34 |
@@ -219,7 +219,7 @@ rootdn_load_config(Slapi_PBlock *pb)
|
|
|
dc8c34 |
Slapi_Entry *e = NULL;
|
|
|
dc8c34 |
char *openTime = NULL;
|
|
|
dc8c34 |
char *closeTime = NULL;
|
|
|
dc8c34 |
- char *token, *iter, *copy;
|
|
|
dc8c34 |
+ char *token, *iter = NULL, *copy;
|
|
|
dc8c34 |
char hour[3], min[3];
|
|
|
dc8c34 |
int result = 0;
|
|
|
dc8c34 |
int time;
|
|
|
dc8c34 |
diff --git a/ldap/servers/slapd/back-ldbm/ldbm_attr.c b/ldap/servers/slapd/back-ldbm/ldbm_attr.c
|
|
|
dc8c34 |
index 16ffa42..1992174 100644
|
|
|
dc8c34 |
--- a/ldap/servers/slapd/back-ldbm/ldbm_attr.c
|
|
|
dc8c34 |
+++ b/ldap/servers/slapd/back-ldbm/ldbm_attr.c
|
|
|
dc8c34 |
@@ -509,7 +509,7 @@ attr_index_parse_idlistsize(struct attrinfo *ai, const char *strval, struct inde
|
|
|
dc8c34 |
int rc = 0; /* assume success */
|
|
|
dc8c34 |
char *mystr = slapi_ch_strdup(strval); /* copy for strtok */
|
|
|
dc8c34 |
char *values = NULL;
|
|
|
dc8c34 |
- char *lasts, *val, *ptr;
|
|
|
dc8c34 |
+ char *lasts = NULL, *val, *ptr;
|
|
|
dc8c34 |
int seen_limit = 0, seen_type = 0, seen_flags = 0, seen_values = 0;
|
|
|
dc8c34 |
Slapi_Attr *attr = &ai->ai_sattr;
|
|
|
dc8c34 |
|
|
|
dc8c34 |
--
|
|
|
dc8c34 |
1.9.3
|
|
|
dc8c34 |
|