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

Commit 7eae30d5 authored by Yu Shan's avatar Yu Shan
Browse files

Fix a nullptr deref in ref VHAL.

Check for nullptr returned from refreshTimestamp if the property
is not available.

Test: m
Bug: 319147839
Change-Id: Idb214a4f889bdd11e6d4f3979fd7d2e38ded7873
parent 77a4d168
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -494,7 +494,11 @@ void DefaultVehicleHal::onContinuousPropertyTimer(const std::vector<int32_t>& pr
            }

            for (int areaId : areaIds) {
                auto v = pool.obtain(*mPropStore->refreshTimestamp(property, areaId));
                auto refreshedProp = mPropStore->refreshTimestamp(property, areaId);
                VehiclePropValuePtr v = nullptr;
                if (refreshedProp != nullptr) {
                    v = pool.obtain(*refreshedProp);
                }
                if (v.get()) {
                    events.push_back(std::move(v));
                }