From 6781d02916ada0ee87df09b68e4082e44932b25d Mon Sep 17 00:00:00 2001 From: Ningyuan Wang Date: Mon, 20 Mar 2017 12:39:21 -0700 Subject: 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 --- .../java/com/android/server/wifi/scanner/WifiScanningServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'service') 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: -- cgit v1.2.3