ldap/servers/plugins/replication/repl5_plugins.c | 18 +++++++++---------
ldap/servers/slapd/attr.c | 3 +--
2 files changed, 10 insertions(+), 11 deletions(-)
New commits:
commit ba70aac1991a04455ba83362e22c33f7f6ab227a
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Wed Jul 31 10:52:21 2013 -0600
fix coverity 11915 - dead code - introduced with fix for ticket 346
just get rid of unused variable was_present_null
reviewed by: nhosoi (Thanks!)
diff --git a/ldap/servers/slapd/attr.c b/ldap/servers/slapd/attr.c
index 8ab7135..b9cbe17 100644
--- a/ldap/servers/slapd/attr.c
+++ b/ldap/servers/slapd/attr.c
@@ -822,7 +822,6 @@ attr_add_valuearray(Slapi_Attr *a, Slapi_Value **vals, const char
*dn)
int i = 0;
int numofvals = 0;
int duplicate_index = -1;
- int was_present_null = 0;
int rc = LDAP_SUCCESS;
if (valuearray_isempty(vals)) {
@@ -883,7 +882,7 @@ attr_add_valuearray(Slapi_Attr *a, Slapi_Value **vals, const char
*dn)
duplicate_string,
a->a_type,
dn ? dn : "<null>",
- (was_present_null ? "duplicate new value" : "value
exists"));
+ "value exists");
}
return( rc );
}
commit b61143cc79cb5c3e23f403c4980f8a03ab7426c0
Author: Rich Megginson <rmeggins(a)redhat.com>
Date: Wed Jul 31 10:49:18 2013 -0600
fix coverity 11895 - null deref - caused by fix to ticket 47392
reviewed by: nhosoi (Thanks!)
diff --git a/ldap/servers/plugins/replication/repl5_plugins.c
b/ldap/servers/plugins/replication/repl5_plugins.c
index 4c048dc..9c97ea6 100644
--- a/ldap/servers/plugins/replication/repl5_plugins.c
+++ b/ldap/servers/plugins/replication/repl5_plugins.c
@@ -1202,9 +1202,13 @@ write_changelog_and_ruv (Slapi_PBlock *pb)
just read from the changelog in either the supplier or consumer ruv
*/
if (0 == return_value) {
- char csn_str[CSN_STRSIZE];
+ char csn_str[CSN_STRSIZE] = {'\0'};
CSN *opcsn;
int rc;
+ const char *dn = op_params ? REPL_GET_DN(&op_params->target_address) :
"unknown";
+ char *uniqueid = op_params ? op_params->target_address.uniqueid :
"unknown";
+ unsigned long optype = op_params ? op_params->operation_type : 0;
+ CSN *oppcsn = op_params ? op_params->csn : NULL;
slapi_pblock_get( pb, SLAPI_OPERATION, &op );
opcsn = operation_get_csn(op);
@@ -1213,18 +1217,14 @@ write_changelog_and_ruv (Slapi_PBlock *pb)
slapi_log_error(SLAPI_LOG_REPL, repl_plugin_name,
"write_changelog_and_ruv: RUV already covers csn for "
"%s (uniqid: %s, optype: %lu) csn %s\n",
- REPL_GET_DN(&op_params->target_address),
- op_params->target_address.uniqueid,
- op_params->operation_type,
- csn_as_string(op_params->csn, PR_FALSE, csn_str));
+ dn, uniqueid, optype,
+ csn_as_string(oppcsn, PR_FALSE, csn_str));
} else if (rc != RUV_SUCCESS) {
slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name,
"write_changelog_and_ruv: failed to update RUV for "
"%s (uniqid: %s, optype: %lu) to changelog csn %s\n",
- REPL_GET_DN(&op_params->target_address),
- op_params->target_address.uniqueid,
- op_params->operation_type,
- csn_as_string(op_params->csn, PR_FALSE, csn_str));
+ dn, uniqueid, optype,
+ csn_as_string(oppcsn, PR_FALSE, csn_str));
}
}