summaryrefslogtreecommitdiff
path: root/service
diff options
context:
space:
mode:
authorNingyuan Wang <nywang@google.com>2017-03-20 12:39:21 -0700
committerNingyuan Wang <nywang@google.com>2017-03-22 10:14:51 -0700
commit6781d02916ada0ee87df09b68e4082e44932b25d (patch)
tree6186f08f3240a5837e6d78d67cb5714cfe3fd218 /service
parent168fba718720b54cf0a88cfad7f96948925fb1e3 (diff)
Do not return member array reference upon CMD_GET_SINGLE_SCAN_RESULTS
If the caller is within the same process, this might cause concurrent access of mCachedScanResults. This patch uses a copy of this array instead. Bug: 34670610 Test: compile, unit tests, integration test Change-Id: I143ce97f21f172fe195a3b97383b9fb8d6e5e5b2
Diffstat (limited to 'service')
-rw-r--r--service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java2
1 files changed, 1 insertions, 1 deletions
diff --git a/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java b/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
index a9f4b49ba..f22425dd7 100644
--- a/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
+++ b/service/java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java
@@ -548,7 +548,7 @@ public class WifiScanningServiceImpl extends IWifiScanner.Stub {
if (DBG) localLog("ignored full scan result event");
return HANDLED;
case WifiScanner.CMD_GET_SINGLE_SCAN_RESULTS:
- msg.obj = new WifiScanner.ParcelableScanResults(mCachedScanResults);
+ msg.obj = new WifiScanner.ParcelableScanResults(mCachedScanResults.clone());
replySucceeded(msg);
return HANDLED;
default: