diff options
| author | fengweihao <[email protected]> | 2023-08-14 18:28:32 +0800 |
|---|---|---|
| committer | fengweihao <[email protected]> | 2023-08-14 18:28:32 +0800 |
| commit | 17a9d12b4017b1a66c707903cdeb5a7e9452edd5 (patch) | |
| tree | e0c742c446ed6b6bcb302a21fb5748e2228cf4d8 | |
| parent | a5de936c90755fbaaf1c36e064eead912cd41cb3 (diff) | |
bugfix:同一个Object下,存在相同内容的item,导致命中路径Object重复v3.0.19-20230815
| -rw-r--r-- | platform/src/verify_matcher.cpp | 7 |
1 files changed, 7 insertions, 0 deletions
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); } |
