Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1a3456f0 authored by Arun Sharma's avatar Arun Sharma
Browse files

FastbootDevice::boot1_1 null pointer dereference

FastbootDevice::boot1_1 attempts to dereference a null pointer when the
boot_control_hal_ is not set. It needs a guard statement to prevent
that.

Test: Manually tested on device without BootControl.
Bug: 301682120
Change-Id: Id86bcb915c8e2857bda26f64738dd5b643048e98
parent b533f531
Loading
Loading
Loading
Loading
+2 −1
Original line number Original line Diff line number Diff line
@@ -151,7 +151,8 @@ std::string FastbootDevice::GetCurrentSlot() {
}
}


BootControlClient* FastbootDevice::boot1_1() const {
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 boot_control_hal_.get();
    }
    }
    return nullptr;
    return nullptr;