소스 검색

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;