Merge cherrypicks of ['googleplex-android-review.googlesource.com/29034296'] into 24Q3-release.

Change-Id: Ie8c833054f2a4e11698f237caab65a4af17ea94f
This commit is contained in:
Android Build Coastguard Worker 2024-09-20 00:26:44 +00:00
commit 133708e84a

View File

@ -384,7 +384,7 @@ ScopedAStatus BootControl::isSlotMarkedSuccessful(int32_t in_slot, bool* _aidl_r
*_aidl_return = true;
return ScopedAStatus::ok();
}
if (in_slot >= slots)
if (in_slot < 0 || in_slot >= slots)
return ScopedAStatus::fromServiceSpecificErrorWithMessage(
INVALID_SLOT, (std::string("Invalid slot ") + std::to_string(in_slot)).c_str());