From a635fc3a23f690d6089324e3cd7e91b4f5943a8d Mon Sep 17 00:00:00 2001 From: =?utf8?q?=E5=AD=99=E6=98=A5=E9=98=B3?= Date: Mon, 13 Oct 2025 14:55:03 +0800 Subject: [PATCH] =?utf8?q?=E4=BF=AE=E5=A4=8D=E6=97=A0=E9=85=8D=E7=BD=AE?= =?utf8?q?=E6=97=B6=EF=BC=8Cconfigmodel=E8=AF=BB=E5=8F=96=E4=B9=B1?= =?utf8?q?=E7=A0=81=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- code/sdk/zhihui/config/src/ConfigModel.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/code/sdk/zhihui/config/src/ConfigModel.cpp b/code/sdk/zhihui/config/src/ConfigModel.cpp index a23dcf2e2..e1231aa2a 100644 --- a/code/sdk/zhihui/config/src/ConfigModel.cpp +++ b/code/sdk/zhihui/config/src/ConfigModel.cpp @@ -109,6 +109,7 @@ namespace OHOS { char* stringtmp=(char*)malloc(MAX_STRING_DATA_LEN); if (stringtmp == NULL) return "-2"; + memset(stringtmp,0,MAX_STRING_DATA_LEN); int value_len = UtilsGetValue(field_name,stringtmp,MAX_STRING_DATA_LEN); if (value_len<0) { @@ -133,6 +134,7 @@ namespace OHOS char *buf = (char*)malloc(MAX_NUM_BUF_LEN); if (buf == NULL) return 0.0f; + memset(buf,0,MAX_NUM_BUF_LEN); int value_len = UtilsGetValue(field_name,buf,MAX_NUM_BUF_LEN); if (value_len<0) { @@ -169,6 +171,7 @@ namespace OHOS { char *buf = (char*)malloc(MAX_NUM_BUF_LEN); if (buf == NULL) return 0; + memset(buf,0,MAX_NUM_BUF_LEN); int value_len = UtilsGetValue(field_name,buf,MAX_NUM_BUF_LEN); if (value_len<0) { @@ -205,6 +208,7 @@ namespace OHOS { char *buf = (char*)malloc(MAX_NUM_BUF_LEN); if (buf == NULL) return false; + memset(buf,0,MAX_NUM_BUF_LEN); int value_len = UtilsGetValue(field_name,buf,MAX_NUM_BUF_LEN); CONFIG_DEBUG("ReadKVData_Bool %s = %s (%d)\n",field_name,buf,value_len); if (value_len<0) -- 2.17.1