安全排查

Signed-off-by: zhangxinyu <zhangxinyu74@huawei.com>
This commit is contained in:
zhangxinyu
2023-08-24 21:02:39 +08:00
parent fde56f3cf9
commit 53917a97fd
2 changed files with 5 additions and 0 deletions
@@ -793,6 +793,7 @@ uint8_t GetBundleNameForUid(int32_t uid, char **bundleName)
resultOfGetBundleNameForUid.bundleName, resultOfGetBundleNameForUid.length);
AdapterFree(resultOfGetBundleNameForUid.bundleName);
if (err != EOK) {
AdapterFree(*bundleName);
return ERR_APPEXECFWK_SYSTEM_INTERNAL_ERROR;
}
return resultOfGetBundleNameForUid.resultCode;
@@ -48,12 +48,16 @@ uint8_t BundleInfoCreator::SaveBundleInfo(const BundleProfile &bundleProfile, Bu
size_t index = std::string(info->codePath).find_last_of(PATH_SEPARATOR);
if (index == std::string::npos) {
HILOG_ERROR(HILOG_MODULE_APP, "codePath is invalid!");
BundleInfoUtils::FreeBundleInfo(*bundleInfo);
*bundleInfo = nullptr;
return ERR_APPEXECFWK_INSTALL_FAILED_INTERNAL_ERROR;
}
installDirPath = std::string(info->codePath).substr(0, index);
index = std::string(info->dataPath).find_last_of(PATH_SEPARATOR);
if (index == std::string::npos) {
HILOG_ERROR(HILOG_MODULE_APP, "dataPath is invalid!");
BundleInfoUtils::FreeBundleInfo(*bundleInfo);
*bundleInfo = nullptr;
return ERR_APPEXECFWK_INSTALL_FAILED_INTERNAL_ERROR;
}
dataDirPath = std::string(info->dataPath).substr(0, index);