diff options
| author | 2020-10-23 21:26:03 +0000 | |
|---|---|---|
| committer | 2020-10-23 21:26:03 +0000 | |
| commit | 049abe0406fcf0ab9f27d6e80e89222e29874a23 (patch) | |
| tree | dd156765ff6f111e89ba9df8a6ee1064990a529f | |
| parent | 1aba8aec4a279fad8e6e1a3eeaa03dd4c0868af0 (diff) | |
| parent | 7db7c67480152b43658e1ae0f0a67806b6209928 (diff) | |
Merge "Supplement fuzzer with testcase for ParcelableHolder and related NDK API"
| -rw-r--r-- | libs/binder/parcel_fuzzer/binder_ndk.cpp | 20 |
1 files changed, 20 insertions, 0 deletions
diff --git a/libs/binder/parcel_fuzzer/binder_ndk.cpp b/libs/binder/parcel_fuzzer/binder_ndk.cpp index 29da8f7537..008780cb2e 100644 --- a/libs/binder/parcel_fuzzer/binder_ndk.cpp +++ b/libs/binder/parcel_fuzzer/binder_ndk.cpp @@ -18,6 +18,7 @@ #include "binder_ndk.h" #include <android/binder_parcel_utils.h> +#include <android/binder_parcelable_utils.h> #include "util.h" @@ -54,6 +55,25 @@ std::vector<ParcelRead<NdkParcelAdapter>> BINDER_NDK_PARCEL_READ_FUNCTIONS{ binder_status_t status = AParcel_readStatusHeader(p.aParcel(), t.getR()); FUZZ_LOG() << "read status header: " << status; }, + [](const NdkParcelAdapter& p, uint8_t /*data*/) { + FUZZ_LOG() << "about to getDataSize the parcel"; + AParcel_getDataSize(p.aParcel()); + FUZZ_LOG() << "getDataSize done"; + }, + [](const NdkParcelAdapter& p, uint8_t data) { + FUZZ_LOG() << "about to read a ParcelableHolder"; + ndk::AParcelableHolder ph {(data % 2 == 1) ? ndk::STABILITY_LOCAL : ndk::STABILITY_VINTF}; + binder_status_t status = AParcel_readParcelable(p.aParcel(), &ph); + FUZZ_LOG() << "read the ParcelableHolder: " << status; + }, + [](const NdkParcelAdapter& p, uint8_t data) { + FUZZ_LOG() << "about to appendFrom"; + AParcel* parcel = AParcel_create(); + binder_status_t status = AParcel_appendFrom(p.aParcel(), parcel, 0, data); + AParcel_delete(parcel); + FUZZ_LOG() << "appendFrom: " << status; + }, + PARCEL_READ(int32_t, AParcel_readInt32), PARCEL_READ(uint32_t, AParcel_readUint32), PARCEL_READ(int64_t, AParcel_readInt64), |