diff --git a/modules/sandbox/normal/sandbox_core.cpp b/modules/sandbox/normal/sandbox_core.cpp index 0959eafb09bd6c6ba8a3b285c4bc94d53f2db71f..adda2da32e2f5be8feb38f580d4beb75b3b9fe02 100644 --- a/modules/sandbox/normal/sandbox_core.cpp +++ b/modules/sandbox/normal/sandbox_core.cpp @@ -1056,8 +1056,6 @@ int32_t SandboxCore::ChangeCurrentDir(std::string &sandboxPackagePath, const std return ret; } - - static const DecDenyPathTemplate DEC_DENY_PATH_MAP[] = { {"ohos.permission.READ_WRITE_DOWNLOAD_DIRECTORY", "/storage/Users/currentUser/Download"}, {"ohos.permission.READ_WRITE_DESKTOP_DIRECTORY", "/storage/Users/currentUser/Desktop"}, diff --git a/modules/sandbox/normal/sandbox_shared_mount.cpp b/modules/sandbox/normal/sandbox_shared_mount.cpp index 63a023775d60d38b0c4fcb29105da543e48a4238..fae454c27f6d4ddee6785702a06d66f143d69e2c 100644 --- a/modules/sandbox/normal/sandbox_shared_mount.cpp +++ b/modules/sandbox/normal/sandbox_shared_mount.cpp @@ -489,9 +489,15 @@ static int ParseDataGroupList(AppSpawnMgr *content, const AppSpawningCtx *proper { int ret = 0; cJSON *dataGroupList = GetJsonObjFromExtInfo(property, DATA_GROUP_SOCKET_TYPE); - APPSPAWN_CHECK(dataGroupList != nullptr, return APPSPAWN_ARG_INVALID, "dataGroupList is empty"); - APPSPAWN_CHECK(cJSON_IsArray(dataGroupList), cJSON_Delete(dataGroupList); - return APPSPAWN_ARG_INVALID, "dataGroupList is not Array"); + if (dataGroupList == nullptr) { + APPSPAWN_LOGE("dataGroupList is empty"); + return APPSPAWN_ARG_INVALID; + } + + if (!cJSON_IsArray(dataGroupList)) { + cJSON_Delete(dataGroupList); + return APPSPAWN_ARG_INVALID; + } // Iterate through the array (assuming groups is an array) cJSON *item = nullptr;