summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorfengweihao <[email protected]>2023-10-12 18:40:45 +0800
committerfengweihao <[email protected]>2023-10-12 18:40:45 +0800
commit7a0bc4708784af6d4d362a790cad2881fbee15d1 (patch)
tree6e8d86d198a9a88608350502278314e7e66f13fb
parent448081af1d56f120e2777f2e16ec379fe0b7fcef (diff)
命中Object对象路径中增加notFlag字段v3.0.21-20231012
修复输出日志时数组越界问题 修只有TunnelA命中时,命中Object对象路径中缺少tablename
-rw-r--r--platform/src/verify_matcher.cpp14
-rw-r--r--platform/src/verify_policy.cpp4
2 files changed, 3 insertions, 15 deletions
diff --git a/platform/src/verify_matcher.cpp b/platform/src/verify_matcher.cpp
index 21d8c3d..a0417cb 100644
--- a/platform/src/verify_matcher.cpp
+++ b/platform/src/verify_matcher.cpp
@@ -1114,19 +1114,6 @@ int get_attributes_table_name(struct request_query_obj *query_obj, int num, int
if (query_obj[i].nth_scan[j] == Nth_scan)
{
attributeObj=query_obj[i].attributes;
- /*tunnel filter*/
- if(tunnel_endpoint_x == 2)
- {
- subchild = cJSON_GetObjectItem(attributeObj, "attributeName");
- if(subchild && subchild->type==cJSON_String)
- {
- if(0 == strcasecmp(subchild->valuestring, "tunnel_endpointa"))
- {
- break;
- }
- }
- }
-
subchild = cJSON_GetObjectItem(attributeObj, "tableName");
if(subchild && subchild->type==cJSON_String)
{
@@ -1217,6 +1204,7 @@ int http_hit_policy_list(struct verify_policy_query *verify_policy, int num, siz
}
topObject=cJSON_CreateObject();
cJSON_AddNumberToObject(topObject, "objectId", ctx->hit_path[j].top_group_id);
+ cJSON_AddNumberToObject(topObject, "notFlag", ctx->hit_path[j].NOT_flag);
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);
diff --git a/platform/src/verify_policy.cpp b/platform/src/verify_policy.cpp
index 0bf7a87..f87245b 100644
--- a/platform/src/verify_policy.cpp
+++ b/platform/src/verify_policy.cpp
@@ -245,7 +245,7 @@ static struct ipaddr * get_ip_from_json(cJSON *attributeValue, const char *attri
static int get_attribute_from_json(int curr_id, cJSON* subchild, struct verify_policy_query *policy_query)
{
int xret = -1;
- char buff[VERIFY_STRING_MAX], *p = NULL;
+ char buff[VERIFY_STRING_MAX*2], *p = NULL;
cJSON* item = NULL, *attributeValue=NULL;
p = buff;
@@ -310,7 +310,7 @@ static int get_attribute_from_json(int curr_id, cJSON* subchild, struct verify_p
}
}
mesa_runtime_log(RLOG_LV_INFO, "[I] %s", buff);
- memset(buff, 0, VERIFY_STRING_MAX);
+ memset(buff, 0, VERIFY_STRING_MAX*2);
end:
xret = 1;
finish: