Browse Source

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().
Nathan Kinder 14 years ago
parent
commit
c772157257
1 changed files with 3 additions and 1 deletions
  1. 3 1
      ldap/servers/plugins/memberof/memberof.c

+ 3 - 1
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);