GetBundleStatsForIncrease增加参数安全性判断

Signed-off-by: yangjingbo10 <yangjingbo10@huawei.com>

Change-Id: Ia15892bd765aed6bb76ab2b0b885c2f8295f9549
This commit is contained in:
yang-jingbo1985 2024-03-06 11:42:51 +08:00
parent bba4f7e0ab
commit cecf38ffd4

View File

@ -867,6 +867,11 @@ int32_t QuotaManager::GetBundleStatsForIncrease(uint32_t userId, const std::vect
const std::vector<int64_t> &incrementalBackTimes, std::vector<int64_t> &pkgFileSizes)
{
LOGI("GetBundleStatsForIncrease start");
if (bundleNames.size() != incrementalBackTimes.size()) {
LOGE("Invalid paramters, size of bundleNames should match incrementalBackTimes.");
return E_SYS_ERR;
}
for (size_t i = 0; i < bundleNames.size(); i++) {
std::string bundleName = bundleNames[i];
int64_t lastBackupTime = incrementalBackTimes[i];