From a1f2fde9ddef102de1d2a637d035c67bf06e514f Mon Sep 17 00:00:00 2001 From: wangmenglan Date: Thu, 4 Jan 2024 14:26:25 +0800 Subject: [PATCH] =?UTF-8?q?bugfix:=20TSG-18316=20=E4=BF=AE=E6=AD=A3?= =?UTF-8?q?=E8=8E=B7=E5=8F=96=E6=8B=A6=E6=88=AA=E7=AD=96=E7=95=A5=E7=BC=96?= =?UTF-8?q?=E8=AF=91=E8=A1=A8=E7=9A=84do=5Flog=E5=AD=97=E6=AE=B5?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- common/src/intercept_policy.cpp | 7 +++++-- 1 file 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) {