From eb4de27dbdd5a7d72d3ccccfe5da5fa356dc48e7 Mon Sep 17 00:00:00 2001 From: xiekaiming Date: Tue, 5 Dec 2023 09:29:01 +0800 Subject: [PATCH] =?UTF-8?q?index=E4=B8=8B=E6=A0=87=E8=B6=8A=E7=95=8C?= =?UTF-8?q?=E5=88=A4=E6=96=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: xiekaiming --- frameworks/config_policy/src/config_policy_utils.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/frameworks/config_policy/src/config_policy_utils.c b/frameworks/config_policy/src/config_policy_utils.c index 06c4187..54d8ca3 100644 --- a/frameworks/config_policy/src/config_policy_utils.c +++ b/frameworks/config_policy/src/config_policy_utils.c @@ -490,7 +490,7 @@ CfgFiles *GetCfgFilesEx(const char *pathSuffix, int followMode, const char *extr access(buf, F_OK) == 0) { files->paths[index++] = strdup(buf); } - for (int j = 0; result && j < result->segCount; j++) { + for (int j = 0; result && j < result->segCount && index < MAX_CFG_POLICY_DIRS_CNT; j++) { if (result->segs[j] && snprintf_s(buf, MAX_PATH_LEN, MAX_PATH_LEN - 1, "%s/%s/%s", dirs->paths[i], result->segs[j], pathSuffix) > 0 && -- Gitee