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

Commit 11104185 authored by Gabriel Biren's avatar Gabriel Biren
Browse files

Check for null callback pointers in the

Vendor HAL AIDL callback util.

Bug: 376249464
Test: m
Change-Id: Ifd48b8d9ba81ce5b59d3a3ea39667390a688bb53
parent c88ce247
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -45,6 +45,11 @@ class AidlCallbackHandler {
    ~AidlCallbackHandler() { invalidate(); }

    bool addCallback(const std::shared_ptr<CallbackType>& cb) {
        if (cb == nullptr) {
            LOG(ERROR) << "Unable to register a null callback";
            return false;
        }

        std::unique_lock<std::mutex> lk(callback_handler_lock_);
        void* cbPtr = reinterpret_cast<void*>(cb->asBinder().get());
        const auto& cbPosition = findCbInSet(cbPtr);