From e2d64f76f41b1722773ce172c0404f8107714b9f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=90=B4=E6=95=8F=E6=9D=B0?= Date: Thu, 5 Jun 2025 07:48:10 +0000 Subject: [PATCH] =?UTF-8?q?=E5=91=8A=E8=AD=A6=E4=BF=AE=E6=94=B9(5.1.0)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 吴敏杰 --- services/safwk/src/main.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/services/safwk/src/main.cpp b/services/safwk/src/main.cpp index 53cacd2..0ff6648 100644 --- a/services/safwk/src/main.cpp +++ b/services/safwk/src/main.cpp @@ -184,10 +184,6 @@ static void InitMallopt(int argc, char *argv[], int& ondemandLoad, int& eventInd #ifdef CONFIG_USE_JEMALLOC_DFX_INTF std::vector malloptStrList; #endif - if (argc < ARGC_LIMIT) { - HILOGE(TAG, "argc is too small"); - return; - } for (int i = 0; i < argc - 1; ++i) { if (strcmp(PARAM_PREFIX_M, argv[i]) == 0) { #ifdef CONFIG_USE_JEMALLOC_DFX_INTF @@ -218,6 +214,10 @@ static void InitMallopt(int argc, char *argv[], int& ondemandLoad, int& eventInd int main(int argc, char *argv[]) { + if (argc < ARGC_LIMIT || argc > ARGC_MAX_COUNT) { + HILOGE(TAG, "argc : %{public}d is invalid", argc); + return -1; + } HILOGI(TAG, "enter SAFWK main, proc:%{public}d", getpid()); int ondemandLoad = ONDEMAND_LOAD; int eventIndex = EVENT_INDEX; -- Gitee