ldap/servers/plugins/memberof/memberof.c | 4 +++-
ldap/servers/plugins/replication/cl5_api.c | 10 ++++++++--
2 files changed, 11 insertions(+), 3 deletions(-)
New commits:
commit c772157257d2e0bbe47df7d9a74d009b6f1fc831
Author: Nathan Kinder <nkinder(a)redhat.com>
Date: Tue Mar 22 10:32:16 2011 -0700
Bug 689537 - (cov#10608) Fix Coverity NULL pointer dereferences
It is possible that we dereference a NULL pointer in memberOf for
a MODRDN. We should fix this to be safe, though I think it is
extremely unlikely that pre_dn and post_dn will be NULL. We should
check if these variables are NULL before calling
memberof_replace_dn_from_groups().
diff --git a/ldap/servers/plugins/memberof/memberof.c
b/ldap/servers/plugins/memberof/memberof.c
index b21f880..96aa44a 100644
--- a/ldap/servers/plugins/memberof/memberof.c
+++ b/ldap/servers/plugins/memberof/memberof.c
@@ -583,7 +583,9 @@ int memberof_postop_modrdn(Slapi_PBlock *pb)
/* It's possible that this is an entry who is a member
* of other group entries. We need to update any member
* attributes to refer to the new name. */
- memberof_replace_dn_from_groups(pb, &configCopy, pre_dn, post_dn);
+ if (pre_dn && post_dn) {
+ memberof_replace_dn_from_groups(pb, &configCopy, pre_dn, post_dn);
+ }
memberof_unlock();
memberof_free_config(&configCopy);
commit 8424307aa2edf6a92b9f12fc32b03811a8622fb1
Author: Nathan Kinder <nkinder(a)redhat.com>
Date: Tue Mar 22 10:07:04 2011 -0700
Bug 689537 - (cov#10610) Fix Coverity NULL pointer dereferences
The changelog import code releases the replica object when it is
NULL, causing a NULL pointer dereference. We should not be calling
the release function if replica_obj is NULL.
diff --git a/ldap/servers/plugins/replication/cl5_api.c
b/ldap/servers/plugins/replication/cl5_api.c
index b668852..ea47d77 100644
--- a/ldap/servers/plugins/replication/cl5_api.c
+++ b/ldap/servers/plugins/replication/cl5_api.c
@@ -1046,7 +1046,6 @@ cl5ImportLDIF (const char *clDir, const char *ldifFile, Object
**replicas)
"failed to write operation to the changelog: "
"type: %lu, dn: %s\n",
op.operation_type, op.target_address.dn);
- object_release (replica_obj);
slapi_ch_free_string(&replGen);
operation_parameters_done (&op);
goto done;
commit 10c01e297d6f4cf31787c78d1a0b9996418914c9
Author: Nathan Kinder <nkinder(a)redhat.com>
Date: Mon Mar 21 11:15:41 2011 -0700
Bug 689537 - (cov#10699) Fix Coverity NULL pointer dereferences
We should check if replicas is NULL before dereferencing it.
diff --git a/ldap/servers/plugins/replication/cl5_api.c
b/ldap/servers/plugins/replication/cl5_api.c
index b3078b0..b668852 100644
--- a/ldap/servers/plugins/replication/cl5_api.c
+++ b/ldap/servers/plugins/replication/cl5_api.c
@@ -852,7 +852,7 @@ done:;
Description: imports ldif file into changelog; changelog must be in the closed state
Parameters: clDir - changelog dir
ldifFile - absolute path to the ldif file to import
- replicas - optional list of replicas whose data should be imported.
+ replicas - list of replicas whose data should be imported.
Return: CL5_SUCCESS if function is successfull;
CL5_BAD_DATA if invalid parameter is passed;
CL5_BAD_STATE if changelog is open or not inititalized;
@@ -902,6 +902,13 @@ cl5ImportLDIF (const char *clDir, const char *ldifFile, Object
**replicas)
return CL5_BAD_STATE;
}
+ if (replicas == NULL)
+ {
+ slapi_log_error(SLAPI_LOG_FATAL, repl_plugin_name_cl,
+ "cl5ImportLDIF: null list of replicas\n");
+ return CL5_BAD_DATA;
+ }
+
prim_replica_obj = replicas[0];
if (NULL == prim_replica_obj)
{
Show replies by date