Merge "FastbootDevice::boot1_1 null pointer dereference" into main am: 608e33f736 am: 828d85ae89 am: 932fe519f6

Original change: https://android-review.googlesource.com/c/platform/system/core/+/2768099

Change-Id: Ic2cecbd2bb771b682bb6f97e596a0759f804a774
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
This commit is contained in:
Arun Sharma 2023-10-05 18:47:24 +00:00 committed by Automerger Merge Worker
commit 4a2611cc5b

View file

@ -151,7 +151,8 @@ std::string FastbootDevice::GetCurrentSlot() {
}
BootControlClient* FastbootDevice::boot1_1() const {
if (boot_control_hal_->GetVersion() >= android::hal::BootControlVersion::BOOTCTL_V1_1) {
if (boot_control_hal_ &&
boot_control_hal_->GetVersion() >= android::hal::BootControlVersion::BOOTCTL_V1_1) {
return boot_control_hal_.get();
}
return nullptr;