andykimpe / rpms / 389-ds-base

Forked from rpms/389-ds-base 5 months ago
Clone
dc8c34
From 470ff92cb147334a4a59822eb2f15c67e34af3a7 Mon Sep 17 00:00:00 2001
dc8c34
From: Mark Reynolds <mreynolds@redhat.com>
dc8c34
Date: Fri, 14 Jun 2013 15:28:57 -0400
dc8c34
Subject: [PATCH 95/99] Coverity Fixes (Part 7)
dc8c34
dc8c34
11704 - Dereference after null check:  repl5_replica_config.c
dc8c34
dc8c34
https://bugzilla.redhat.com/show_bug.cgi?id=970221
dc8c34
dc8c34
Reviewed by: richm(Thanks!)
dc8c34
(cherry picked from commit a2cfcf7ff93bf2ef7a3cf4ad2ba2c4e0bd098a3a)
dc8c34
(cherry picked from commit e3b8e2f82b3d5b6223c65db8649e7ddcb46ee916)
dc8c34
---
dc8c34
 ldap/servers/plugins/replication/repl5_replica_config.c | 9 +++++++++
dc8c34
 1 file changed, 9 insertions(+)
dc8c34
dc8c34
diff --git a/ldap/servers/plugins/replication/repl5_replica_config.c b/ldap/servers/plugins/replication/repl5_replica_config.c
dc8c34
index 0b72bec..c2ad504 100644
dc8c34
--- a/ldap/servers/plugins/replication/repl5_replica_config.c
dc8c34
+++ b/ldap/servers/plugins/replication/repl5_replica_config.c
dc8c34
@@ -2382,6 +2382,13 @@ delete_cleaned_rid_config(cleanruv_data *clean_data)
dc8c34
      *  Search the config for the exact attribute value to delete
dc8c34
      */
dc8c34
     pb = slapi_pblock_new();
dc8c34
+    if(clean_data->replica){
dc8c34
+        dn = replica_get_dn(clean_data->replica);
dc8c34
+    } else {
dc8c34
+        rc = -1;
dc8c34
+        goto bail;
dc8c34
+    }
dc8c34
+
dc8c34
     dn = replica_get_dn(clean_data->replica);
dc8c34
     slapi_search_internal_set_pb(pb, dn, LDAP_SCOPE_SUBTREE, "nsds5ReplicaCleanRUV=*", NULL, 0, NULL, NULL,
dc8c34
         (void *)plugin_get_default_component_id(), 0);
dc8c34
@@ -2445,6 +2452,8 @@ delete_cleaned_rid_config(cleanruv_data *clean_data)
dc8c34
     slapi_modify_internal_set_pb(pb, dn, mods, NULL, NULL, repl_get_plugin_identity (PLUGIN_MULTIMASTER_REPLICATION), 0);
dc8c34
     slapi_modify_internal_pb (pb);
dc8c34
     slapi_pblock_get(pb, SLAPI_PLUGIN_INTOP_RESULT, &rc);
dc8c34
+
dc8c34
+bail:
dc8c34
     if (rc != LDAP_SUCCESS && rc != LDAP_NO_SUCH_OBJECT){
dc8c34
         slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name, "CleanAllRUV Task: failed to remove replica config "
dc8c34
             "(%d), rid (%d)\n", rc, clean_data->rid);
dc8c34
-- 
dc8c34
1.8.1.4
dc8c34