ソースを参照

Bug 630097 - (cov#15477) NULL dereference in ACL plug-in code

We need to check if aclpb is NULL before dereferencing it.  The
proper thing to do here is to make aclplugin_preop_common() return
an error to the LDAP client and to return 1 since the whole purpose
of this function is to initialize the aclpb. Doing this will avoid
the NULL dereference.
Nathan Kinder 15 年 前
コミット
b83f966e5c
1 ファイル変更6 行追加0 行削除
  1. 6 0
      ldap/servers/plugins/acl/aclplugin.c

+ 6 - 0
ldap/servers/plugins/acl/aclplugin.c

@@ -205,6 +205,12 @@ aclplugin_preop_common( Slapi_PBlock *pb )
 
 	aclpb = acl_get_aclpb ( pb, ACLPB_BINDDN_PBLOCK );
 
+	if (aclpb == NULL) {
+		slapi_log_error( SLAPI_LOG_ACL, plugin_name, "aclplugin_preop_common: Error: aclpb is NULL\n" );
+		slapi_send_ldap_result( pb, LDAP_OPERATIONS_ERROR, NULL, NULL, 0, NULL );
+		return 1;
+	}
+
         /* See if we have initialized already */
         if ( aclpb->aclpb_state & ACLPB_INITIALIZED ) goto done;