summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChen Baoyu <chen.baoyu@zte.com.cn>2023-03-20 14:51:27 +0800
committerJack Yu <jackyu@google.com>2023-03-24 17:56:53 +0000
commita2881ffbd0d395818fef62f628898f1c60d36ae0 (patch)
treefeb35d2af386826c333a7d81a3647cf78dfa7330
parent2550e7a719ad0e67f968e4bfcabb2483f3216df4 (diff)
Fix crash issue on test case RadioHidlTest_v1_5#startNetworkScan.
Bad safe_union access is raised by calling the GET method of eutranBands(), because in default ctor of safe_union RadioAccessSpecifier::Bands hidl_d is assigned with hidl_discriminator::geranBands, which conflicts with hidl_discriminator::eutranBands, and leads to crash. Should use the SET method of eutranBands(&) for assignment purpose. Fix: 275077563 Bug: 271642958 Change-Id: Ie241e8968eb7f9a1297203be2ab4e0a1bf738dea Signed-off-by: Jia Jia <jia.jia@zte.com.cn>
-rw-r--r--radio/1.5/vts/functional/radio_hidl_hal_api.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/radio/1.5/vts/functional/radio_hidl_hal_api.cpp b/radio/1.5/vts/functional/radio_hidl_hal_api.cpp
index 5539b9c1ab..316c308115 100644
--- a/radio/1.5/vts/functional/radio_hidl_hal_api.cpp
+++ b/radio/1.5/vts/functional/radio_hidl_hal_api.cpp
@@ -565,9 +565,9 @@ TEST_P(RadioHidlTest_v1_5, startNetworkScan) {
serial = GetRandomSerialNumber();
::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands band17;
- band17.eutranBands() = {::android::hardware::radio::V1_5::EutranBands::BAND_17};
+ band17.eutranBands({::android::hardware::radio::V1_5::EutranBands::BAND_17});
::android::hardware::radio::V1_5::RadioAccessSpecifier::Bands band20;
- band20.eutranBands() = {::android::hardware::radio::V1_5::EutranBands::BAND_20};
+ band20.eutranBands({::android::hardware::radio::V1_5::EutranBands::BAND_20});
::android::hardware::radio::V1_5::RadioAccessSpecifier specifier17 = {
.radioAccessNetwork = ::android::hardware::radio::V1_5::RadioAccessNetworks::EUTRAN,
.bands = band17,