mirror of
https://gitee.com/openharmony/accessibility
synced 2025-01-06 03:19:44 +00:00
!1207 无障碍修改校验外部读入数据,修改部分日志
Merge pull request !1207 from qianchuang/master
This commit is contained in:
commit
43eb51799c
@ -115,7 +115,10 @@ ErrCode AccessibilityElementOperatorCallbackStub::HandleSetSearchElementInfoByAc
|
||||
|
||||
int32_t accessibilityInfosize = data.ReadInt32();
|
||||
std::vector<AccessibilityElementInfo> tmpData;
|
||||
ContainerSecurityVerify(data, accessibilityInfosize, tmpData.max_size());
|
||||
bool verifyResult = ContainerSecurityVerify(data, accessibilityInfosize, tmpData.max_size());
|
||||
if (!verifyResult || accessibilityInfosize < 0 || accessibilityInfosize > INT32_MAX) {
|
||||
return TRANSACTION_ERR;
|
||||
}
|
||||
for (int32_t i = 0; i < accessibilityInfosize; i++) {
|
||||
sptr<AccessibilityElementInfoParcel> accessibilityInfo =
|
||||
data.ReadStrongParcelable<AccessibilityElementInfoParcel>();
|
||||
@ -147,7 +150,10 @@ ErrCode AccessibilityElementOperatorCallbackStub::HandleSetSearchElementInfoByTe
|
||||
HILOG_DEBUG();
|
||||
std::vector<AccessibilityElementInfo> infos {};
|
||||
int32_t accessibilityInfosize = data.ReadInt32();
|
||||
ContainerSecurityVerify(data, accessibilityInfosize, infos.max_size());
|
||||
bool verifyResult = ContainerSecurityVerify(data, accessibilityInfosize, infos.max_size());
|
||||
if (!verifyResult || accessibilityInfosize < 0 || accessibilityInfosize > INT32_MAX) {
|
||||
return TRANSACTION_ERR;
|
||||
}
|
||||
for (int32_t i = 0; i < accessibilityInfosize; i++) {
|
||||
sptr<AccessibilityElementInfoParcel> accessibilityInfo =
|
||||
data.ReadStrongParcelable<AccessibilityElementInfoParcel>();
|
||||
|
@ -383,7 +383,10 @@ ErrCode AccessibleAbilityChannelStub::HandleSetTargetBundleName(MessageParcel &d
|
||||
HILOG_DEBUG();
|
||||
std::vector<std::string> targetBundleNames;
|
||||
int32_t size = data.ReadInt32();
|
||||
ContainerSecurityVerify(data, size, targetBundleNames.max_size());
|
||||
bool verifyResult = ContainerSecurityVerify(data, size, targetBundleNames.max_size());
|
||||
if (!verifyResult || size < 0 || size > INT32_MAX) {
|
||||
return TRANSACTION_ERR;
|
||||
}
|
||||
for (int32_t i = 0; i < size; i++) {
|
||||
std::string temp = data.ReadString();
|
||||
targetBundleNames.emplace_back(temp);
|
||||
|
@ -57,7 +57,10 @@ bool AccessibilityElementInfoParcel::ReadFromParcelSecondPart(Parcel &parcel)
|
||||
{
|
||||
int32_t operationsSize = 0;
|
||||
READ_PARCEL_AND_RETURN_FALSE_IF_FAIL(Int32, parcel, operationsSize);
|
||||
ContainerSecurityVerify(parcel, operationsSize, operations_.max_size());
|
||||
bool verifyResult = ContainerSecurityVerify(parcel, operationsSize, operations_.max_size());
|
||||
if (!verifyResult || operationsSize < 0 || operationsSize > INT32_MAX) {
|
||||
return false;
|
||||
}
|
||||
for (int32_t i = 0; i < operationsSize; i++) {
|
||||
sptr<AccessibleActionParcel> accessibleOperation = parcel.ReadStrongParcelable<AccessibleActionParcel>();
|
||||
if (!accessibleOperation) {
|
||||
|
@ -74,7 +74,9 @@ bool AccessibilityEventInfoParcel::ReadFromParcelSecondPart(Parcel &parcel)
|
||||
int32_t contentSize = 0;
|
||||
READ_PARCEL_AND_RETURN_FALSE_IF_FAIL(Int32, parcel, contentSize);
|
||||
std::string content;
|
||||
ContainerSecurityVerify(parcel, contentSize, contents_.max_size());
|
||||
if (!ContainerSecurityVerify(parcel, contentSize, contents_.max_size())) {
|
||||
return false;
|
||||
}
|
||||
for (auto i = 0 ; i < contentSize; i++) {
|
||||
READ_PARCEL_AND_RETURN_FALSE_IF_FAIL(String, parcel, content);
|
||||
AddContent(content);
|
||||
|
@ -30,7 +30,10 @@ bool AccessibilityGestureInjectPathParcel::ReadFromParcel(Parcel &parcel)
|
||||
READ_PARCEL_AND_RETURN_FALSE_IF_FAIL(Int64, parcel, durationTime_);
|
||||
int32_t positionSize = 0;
|
||||
READ_PARCEL_AND_RETURN_FALSE_IF_FAIL(Int32, parcel, positionSize);
|
||||
ContainerSecurityVerify(parcel, positionSize, positions_.max_size());
|
||||
bool verifyResult = ContainerSecurityVerify(parcel, positionSize, positions_.max_size());
|
||||
if (!verifyResult || positionSize < 0 || positionSize > INT32_MAX) {
|
||||
return false;
|
||||
}
|
||||
for (auto i = 0; i < positionSize; i++) {
|
||||
AccessibilityGesturePosition position;
|
||||
READ_PARCEL_AND_RETURN_FALSE_IF_FAIL(Float, parcel, position.positionX_);
|
||||
|
Loading…
Reference in New Issue
Block a user