summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorwangmenglan <[email protected]>2024-01-04 14:26:25 +0800
committerwangmenglan <[email protected]>2024-01-04 15:02:52 +0800
commita1f2fde9ddef102de1d2a637d035c67bf06e514f (patch)
tree3c579f614b181fef591fc2747bd38974cff2cc15
parent4e35c47324264b66fa9c9b98097a78ad332a154b (diff)
bugfix: TSG-18316 修正获取拦截策略编译表的do_log字段
-rw-r--r--common/src/intercept_policy.cpp7
1 files changed, 5 insertions, 2 deletions
diff --git a/common/src/intercept_policy.cpp b/common/src/intercept_policy.cpp
index 4a7c38c..4745c50 100644
--- a/common/src/intercept_policy.cpp
+++ b/common/src/intercept_policy.cpp
@@ -51,12 +51,15 @@ static void intercept_param_new_cb(const char *table_name, int table_id, const c
TFE_LOG_ERROR(enforcer->logger, "Invalid intercept action: %s", table_line);
goto error_out;
}
-
- if (maat_helper_read_column(table_line, 5, &do_log, &len) < 0)
+
+ if (maat_helper_read_column(table_line, 5, &offset, &len) < 0)
{
TFE_LOG_ERROR(enforcer->logger, "Invalid do log: %s", table_line);
goto error_out;
}
+ memset(buffer, 0, sizeof(buffer));
+ memcpy(buffer, table_line + offset, MIN(sizeof(buffer), len));
+ do_log = atoi(buffer);
if (maat_helper_read_column(table_line, 7, &offset, &len) < 0)
{