解决同应用下调用ExecuteBatch,传入无效参数导致crash问题

Change-Id: Ic03c05bd2d6885afefb5f1b0526a85a99a60371a
Signed-off-by: HuangXW <huangxinwei4@huawei.com>
This commit is contained in:
HuangXW
2022-10-20 19:55:42 +08:00
parent e55487afae
commit cb13ea6ee8
@@ -409,6 +409,10 @@ bool DataAbilityImpl::CheckExecuteBatchPermission(
size_t size = operations.size();
for (size_t i = 0; i < size; i++) {
std::shared_ptr<DataAbilityOperation> operation = operations[i];
if (operation == nullptr) {
HILOG_ERROR("operation[i] is nullptr, index: %{public}d", static_cast<int32_t>(i));
return false;
}
if (operation->IsInsertOperation() || operation->IsUpdateOperation() || operation->IsDeleteOperation()) {
needCheckWritePermission = true;
} else if (operation->IsAssertOperation()) {