summaryrefslogtreecommitdiff
path: root/wifi/1.0/default/hidl_struct_util.cpp
diff options
context:
space:
mode:
authorRoshan Pius <rpius@google.com>2017-03-07 11:17:08 -0800
committerRoshan Pius <rpius@google.com>2017-03-08 01:21:10 +0000
commit4cf4059cd99aafc33de0f8315b00345062baea95 (patch)
tree356666178a060037a44839ba1c9ef2b0cc219879 /wifi/1.0/default/hidl_struct_util.cpp
parent09258a2afbd022b5d4ebc6c8f7d540ac2fff5429 (diff)
wifi: Fetch the gscan bucket idx from request
We can't rely on the ordering of these buckets to populate their indexes. So, send them explicitly from the caller. Bug: 35989680 Test: Compiles Change-Id: Ife09440935eb3526636c27bfdd40c37c69c7ade2
Diffstat (limited to 'wifi/1.0/default/hidl_struct_util.cpp')
-rw-r--r--wifi/1.0/default/hidl_struct_util.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/wifi/1.0/default/hidl_struct_util.cpp b/wifi/1.0/default/hidl_struct_util.cpp
index 485ae7ea81..5917efc6b2 100644
--- a/wifi/1.0/default/hidl_struct_util.cpp
+++ b/wifi/1.0/default/hidl_struct_util.cpp
@@ -354,7 +354,10 @@ bool convertHidlGscanParamsToLegacy(
hidl_scan_params.buckets[bucket_idx];
legacy_hal::wifi_scan_bucket_spec& legacy_bucket_spec =
legacy_scan_params->buckets[bucket_idx];
- legacy_bucket_spec.bucket = bucket_idx;
+ if (hidl_bucket_spec.bucketIdx >= MAX_BUCKETS) {
+ return false;
+ }
+ legacy_bucket_spec.bucket = hidl_bucket_spec.bucketIdx;
legacy_bucket_spec.band =
convertHidlWifiBandToLegacy(hidl_bucket_spec.band);
legacy_bucket_spec.period = hidl_bucket_spec.periodInMs;