Merge "Use actual consumed buffer length to call AParcel_unmarshal" am: 1c5aa9cb5d am: efda1862d0
Original change: https://android-review.googlesource.com/c/platform/frameworks/native/+/2381612
Change-Id: I043039f016226d3df07b33e7bcc0c0b59954840a
Signed-off-by: Automerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>
diff --git a/libs/binder/tests/parcel_fuzzer/binder_ndk.cpp b/libs/binder/tests/parcel_fuzzer/binder_ndk.cpp
index fa0cc81..08eb27a 100644
--- a/libs/binder/tests/parcel_fuzzer/binder_ndk.cpp
+++ b/libs/binder/tests/parcel_fuzzer/binder_ndk.cpp
@@ -213,8 +213,9 @@
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();
+ const size_t bufferLen = parcelData.size();
NdkParcelAdapter adapter;
- binder_status_t status = AParcel_unmarshal(adapter.aParcel(), buffer, len);
+ binder_status_t status = AParcel_unmarshal(adapter.aParcel(), buffer, bufferLen);
FUZZ_LOG() << "status: " << status;
},