diff --git a/frameworks/ans/src/notification_local_live_view_button.cpp b/frameworks/ans/src/notification_local_live_view_button.cpp index 31fbce6673ce5bce1832895d943cd59aef16615a..8fb5db1f9e210e9dd8364865e008a084caf2464a 100644 --- a/frameworks/ans/src/notification_local_live_view_button.cpp +++ b/frameworks/ans/src/notification_local_live_view_button.cpp @@ -253,6 +253,7 @@ bool NotificationLocalLiveViewButton::ReadFromParcel(Parcel &parcel) } vsize = parcel.ReadUint64(); + vsize = (vsize < BUTTON_MAX_SIZE) ? vsize : BUTTON_MAX_SIZE; for (uint64_t it = 0; it < vsize; ++it) { std::vector iconsResource = {}; if (!parcel.ReadStringVector(&iconsResource)) {