diff options
| -rw-r--r-- | libs/binder/parcel_fuzzer/binder.cpp | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/libs/binder/parcel_fuzzer/binder.cpp b/libs/binder/parcel_fuzzer/binder.cpp index a94f06fa85..96cd215d93 100644 --- a/libs/binder/parcel_fuzzer/binder.cpp +++ b/libs/binder/parcel_fuzzer/binder.cpp @@ -143,6 +143,13 @@ std::vector<ParcelRead<::android::Parcel>> BINDER_PARCEL_READ_FUNCTIONS { FUZZ_LOG() << "read c-str: " << (str ? str : "<empty string>"); }, PARCEL_READ_OPT_STATUS(android::String8, readString8), + [] (const ::android::Parcel& p, uint8_t /*data*/) { + FUZZ_LOG() << "about to readString8Inplace"; + size_t outLen = 0; + const char* str = p.readString8Inplace(&outLen); + std::string bytes = hexString(str, sizeof(char) * (outLen + 1)); + FUZZ_LOG() << "readString8Inplace: " << bytes << " size: " << outLen; + }, PARCEL_READ_OPT_STATUS(android::String16, readString16), PARCEL_READ_WITH_STATUS(std::unique_ptr<android::String16>, readString16), PARCEL_READ_WITH_STATUS(std::optional<android::String16>, readString16), @@ -150,8 +157,8 @@ std::vector<ParcelRead<::android::Parcel>> BINDER_PARCEL_READ_FUNCTIONS { FUZZ_LOG() << "about to readString16Inplace"; size_t outLen = 0; const char16_t* str = p.readString16Inplace(&outLen); - FUZZ_LOG() << "readString16Inplace: " << hexString(str, sizeof(char16_t) * outLen) - << " size: " << outLen; + std::string bytes = hexString(str, sizeof(char16_t) * (outLen + 1)); + FUZZ_LOG() << "readString16Inplace: " << bytes << " size: " << outLen; }, PARCEL_READ_WITH_STATUS(android::sp<android::IBinder>, readStrongBinder), PARCEL_READ_WITH_STATUS(android::sp<android::IBinder>, readNullableStrongBinder), |