!7221 【安全问题】HandDeliverySignProfile增加校验

Merge pull request !7221 from xuyicong/feat_HandleDeliverySignProfile
This commit is contained in:
openharmony_ci 2024-10-14 12:34:02 +00:00 committed by Gitee
commit 3c7254ec7c
No known key found for this signature in database
GPG Key ID: 173E9B9CA92EEF8F

View File

@ -767,7 +767,7 @@ bool InstalldHost::HandDeliverySignProfile(MessageParcel &data, MessageParcel &r
{
std::string bundleName = Str16ToStr8(data.ReadString16());
int32_t profileBlockLength = data.ReadInt32();
if (profileBlockLength == 0 || profileBlockLength > Constants::MAX_PARCEL_CAPACITY) {
if (profileBlockLength <= 0 || profileBlockLength > Constants::MAX_PARCEL_CAPACITY) {
WRITE_PARCEL_AND_RETURN_FALSE_IF_FAIL(Int32, reply, ERR_APPEXECFWK_PARCEL_ERROR);
return false;
}