Przeglądaj źródła

Bug 614511 - fix coverify Defect Type: Null pointer dereferences issues 11846 - 11891

https://bugzilla.redhat.com/show_bug.cgi?id=614511
Resolves: bug 614511
Bug description: Fix coverify Defect Type: Null pointer dereferences issues 11846 - 11891
description: Catch possible NULL pointer in acl_operation_ext_destructor() and acl_init_aclpb().
Endi S. Dewata 15 lat temu
rodzic
commit
ca3ad2b93c
1 zmienionych plików z 6 dodań i 1 usunięć
  1. 6 1
      ldap/servers/plugins/acl/acl_ext.c

+ 6 - 1
ldap/servers/plugins/acl/acl_ext.c

@@ -275,6 +275,11 @@ acl_operation_ext_destructor ( void *ext, void *object, void *parent )
 		(!(aclpb->aclpb_state & ACLPB_INITIALIZED)))
 		goto clean_aclpb;
 
+	if ( NULL == aclpb->aclpb_authorization_sdn ) {
+		slapi_log_error (SLAPI_LOG_FATAL, plugin_name, "NULL aclcb_autorization_sdn\n");
+		goto clean_aclpb;
+	}
+
 	/* get the connection  extension */
 	aclcb = (struct acl_cblock *) acl_get_ext ( ACL_EXT_CONNECTION, parent );
 
@@ -316,7 +321,7 @@ acl_operation_ext_destructor ( void *ext, void *object, void *parent )
 			acl_copyEval_context ( NULL, c_evalContext, &aclcb->aclcb_eval_context, attr_only );
 
 			aclcb->aclcb_aclsignature = aclpb->aclpb_signature;
-			if ( aclcb->aclcb_sdn   &&  aclpb->aclpb_authorization_sdn &&
+			if ( aclcb->aclcb_sdn &&
 					(0 != slapi_sdn_compare ( aclcb->aclcb_sdn,
 										aclpb->aclpb_authorization_sdn ) ) ) {
 				slapi_sdn_set_ndn_byval( aclcb->aclcb_sdn,