diff --git a/services/dbms/src/distributed_bms_host.cpp b/services/dbms/src/distributed_bms_host.cpp index fd0a28a4faae09560f64677741b06796a50b51e2..73d6a45d7bbd8302bd2830b25444dc5c0cab6af7 100644 --- a/services/dbms/src/distributed_bms_host.cpp +++ b/services/dbms/src/distributed_bms_host.cpp @@ -239,6 +239,10 @@ bool DistributedBmsHost::GetParcelableInfos(Parcel &data, std::vector &parcel APP_LOGE("GetParcelableInfos elements num exceeds the limit %{public}d", GET_REMOTE_ABILITY_INFO_MAX_SIZE); return false; } + if (infoSize <= 0) { + APP_LOGE("elements num less than or equal to 0"); + return false; + } for (int32_t i = 0; i < infoSize; i++) { std::unique_ptr info(data.ReadParcelable()); if (!info) {