Browse Source

Ticket #48048 - Fix coverity issues - 2015/2/24

Coverity defect 13070 - Explicit null dereferenced (FORWARD_NULL)
Description: Added NULL check for sdn.
modified: chaining_back_modify in cb_modify.c
Noriko Hosoi 10 years ago
parent
commit
6be713c0ef
1 changed files with 4 additions and 0 deletions
  1. 4 0
      ldap/servers/plugins/chainingdb/cb_modify.c

+ 4 - 0
ldap/servers/plugins/chainingdb/cb_modify.c

@@ -86,6 +86,10 @@ chaining_back_modify ( Slapi_PBlock *pb )
 	}
 
 	slapi_pblock_get( pb, SLAPI_MODIFY_TARGET_SDN, &sdn );
+	if (NULL == sdn) {
+		cb_send_ldap_result(pb, LDAP_INVALID_DN_SYNTAX, NULL, "Null target DN", 0, NULL );
+		return -1;
+	}
 	dn = slapi_sdn_get_dn(sdn);
 
 	if (cb_debug_on()) {