From 17a9d12b4017b1a66c707903cdeb5a7e9452edd5 Mon Sep 17 00:00:00 2001 From: fengweihao Date: Mon, 14 Aug 2023 18:28:32 +0800 Subject: [PATCH] =?UTF-8?q?bugfix:=E5=90=8C=E4=B8=80=E4=B8=AAObject?= =?UTF-8?q?=E4=B8=8B=EF=BC=8C=E5=AD=98=E5=9C=A8=E7=9B=B8=E5=90=8C=E5=86=85?= =?UTF-8?q?=E5=AE=B9=E7=9A=84item=EF=BC=8C=E5=AF=BC=E8=87=B4=E5=91=BD?= =?UTF-8?q?=E4=B8=AD=E8=B7=AF=E5=BE=84Object=E9=87=8D=E5=A4=8D?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- platform/src/verify_matcher.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/platform/src/verify_matcher.cpp b/platform/src/verify_matcher.cpp index ffb5d98..e33245c 100644 --- a/platform/src/verify_matcher.cpp +++ b/platform/src/verify_matcher.cpp @@ -1144,6 +1144,7 @@ int http_hit_policy_list(struct verify_policy_query *verify_policy, int num, siz bool succeeded = false; size_t rules=0, i=0,j=0; int result_config[MAX_SCAN_RESULT] = {0}; + int result_object_id[512] = {0}; int vsys_id = verify_policy->vsys_id; int compile_table_id = verify_policy->compile_table_id; @@ -1202,6 +1203,7 @@ int http_hit_policy_list(struct verify_policy_query *verify_policy, int num, siz } cJSON_AddItemToArray(hit_obj, policy_obj); result_config[i] = ctx->hit_rules[i].config_id; + memset(result_object_id, 0, sizeof(result_object_id)); topObjectList=cJSON_CreateArray(); cJSON_AddItemToObject(policy_obj, "topObjectList", topObjectList); @@ -1209,8 +1211,13 @@ int http_hit_policy_list(struct verify_policy_query *verify_policy, int num, siz { if(ctx->hit_path[j].compile_id > 0 && ctx->hit_path[j].compile_id == ctx->hit_rules[i].config_id) { + if(http_hit_policy_match(result_object_id, j, ctx->hit_path[j].top_group_id)) + { + continue; + } topObject=cJSON_CreateObject(); cJSON_AddNumberToObject(topObject, "objectId", ctx->hit_path[j].top_group_id); + result_object_id[j] = ctx->hit_path[j].top_group_id; get_attributes_table_name(verify_policy->verify_object, num, ctx->hit_path[j].Nth_scan, &ctx->ip_ctx, ctx->tunnel_endpoint_x, topObject); cJSON_AddItemToArray(topObjectList, topObject); }