From 978de0a8a4968774e81e10e716a46bd9e1369479 Mon Sep 17 00:00:00 2001 From: Weilin Xu Date: Wed, 19 Jul 2023 17:20:19 +0000 Subject: [PATCH] Fix null pointer crash in AIDL radio HAL VTS Bug: 277531858 Test: atest VtsHalBroadcastradioAidlTargetTest Change-Id: Icb67c27b9a747411a9bfbd48647e6e6046cf5e8d --- .../aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp b/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp index 8bee1b2d1f..790d60b252 100644 --- a/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp +++ b/broadcastradio/aidl/vts/src/VtsHalBroadcastradioAidlTargetTest.cpp @@ -997,13 +997,12 @@ TEST_P(BroadcastRadioHalTest, SetConfigFlags) { LOG(DEBUG) << "SetConfigFlags Test"; auto get = [&](ConfigFlag flag) -> bool { - bool* gotValue = nullptr; + bool gotValue; - auto halResult = mModule->isConfigFlagSet(flag, gotValue); + auto halResult = mModule->isConfigFlagSet(flag, &gotValue); - EXPECT_FALSE(gotValue == nullptr); EXPECT_TRUE(halResult.isOk()); - return *gotValue; + return gotValue; }; auto notSupportedError = resultToInt(Result::NOT_SUPPORTED);