bootctrl: fixed OOB read in BootControl
Fixed OOB read in BootControl::isSlotMarkedSuccessful() by checking if "in_slot" is negative Flag: EXEMPT bugfix Test: tested on Husky device Bug: 353516777 Change-Id: I634c32a8c12403008fe5a724bc447f82931ae9c5 Signed-off-by: bgkim <bgkim@google.com>
This commit is contained in:
parent
a01bc1d315
commit
b584b9c7e0
1 changed files with 1 additions and 1 deletions
|
@ -384,7 +384,7 @@ ScopedAStatus BootControl::isSlotMarkedSuccessful(int32_t in_slot, bool* _aidl_r
|
||||||
*_aidl_return = true;
|
*_aidl_return = true;
|
||||||
return ScopedAStatus::ok();
|
return ScopedAStatus::ok();
|
||||||
}
|
}
|
||||||
if (in_slot >= slots)
|
if (in_slot < 0 || in_slot >= slots)
|
||||||
return ScopedAStatus::fromServiceSpecificErrorWithMessage(
|
return ScopedAStatus::fromServiceSpecificErrorWithMessage(
|
||||||
INVALID_SLOT, (std::string("Invalid slot ") + std::to_string(in_slot)).c_str());
|
INVALID_SLOT, (std::string("Invalid slot ") + std::to_string(in_slot)).c_str());
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue