summaryrefslogtreecommitdiff
path: root/libs
diff options
context:
space:
mode:
author Pawan Wagh <waghpawan@google.com> 2023-01-06 21:25:24 +0000
committer Pawan Wagh <waghpawan@google.com> 2023-01-06 21:25:24 +0000
commitdddac21641ae4faeb1783a30b373cb3090257265 (patch)
tree60156c30281d369779307d5d38742804df37f9f3 /libs
parent391613caeb4a4cb39c962266e2712e2569104586 (diff)
Use NdkParcelAdapter instead of AParcel_create
AParcel_create was used incorrectly in fuzzer. Using NdkParcelAdapter instead of AParcel_create Bug: 264659127 Test: m SANITIZE_HOST=address binder_parcel_fuzzer Change-Id: I25e47ea095b6119a32af308b5000a9508d71e465
Diffstat (limited to 'libs')
-rw-r--r--libs/binder/tests/parcel_fuzzer/binder_ndk.cpp3
1 files changed, 2 insertions, 1 deletions
diff --git a/libs/binder/tests/parcel_fuzzer/binder_ndk.cpp b/libs/binder/tests/parcel_fuzzer/binder_ndk.cpp
index d32cd80fa0..fa0cc819fa 100644
--- a/libs/binder/tests/parcel_fuzzer/binder_ndk.cpp
+++ b/libs/binder/tests/parcel_fuzzer/binder_ndk.cpp
@@ -213,7 +213,8 @@ std::vector<ParcelRead<NdkParcelAdapter>> BINDER_NDK_PARCEL_READ_FUNCTIONS{
size_t len = provider.ConsumeIntegralInRange<size_t>(0, provider.remaining_bytes());
std::vector<uint8_t> parcelData = provider.ConsumeBytes<uint8_t>(len);
const uint8_t* buffer = parcelData.data();
- binder_status_t status = AParcel_unmarshal(AParcel_create(), buffer, len);
+ NdkParcelAdapter adapter;
+ binder_status_t status = AParcel_unmarshal(adapter.aParcel(), buffer, len);
FUZZ_LOG() << "status: " << status;
},