Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 19ff63ee authored by Steven Moreland's avatar Steven Moreland
Browse files

binder_parcel_fuzzer: cleanup dups/to remove

- setData was represented multiple times
- closeFileDescriptors should be private

Ignore-AOSP-First: fuzzer work
Bug: 328161314
Test: N/A
Change-Id: I3c5d4c96c69788bc71a01ad3af971c99b162a970
parent 72963bc3
Loading
Loading
Loading
Loading
+0 −18
Original line number Diff line number Diff line
@@ -117,14 +117,6 @@ std::vector<ParcelRead<::android::Parcel>> BINDER_PARCEL_READ_FUNCTIONS {
        p.setDataPosition(pos);
        FUZZ_LOG() << "setDataPosition done";
    },
    [] (const ::android::Parcel& p, FuzzedDataProvider& provider) {
        size_t len = provider.ConsumeIntegralInRange<size_t>(0, 1024);
        std::vector<uint8_t> bytes = provider.ConsumeBytes<uint8_t>(len);
        FUZZ_LOG() << "about to setData: " <<(bytes.data() ? HexString(bytes.data(), bytes.size()) : "null");
        // TODO: allow all read and write operations
        (*const_cast<::android::Parcel*>(&p)).setData(bytes.data(), bytes.size());
        FUZZ_LOG() << "setData done";
    },
    PARCEL_READ_NO_STATUS(size_t, allowFds),
    PARCEL_READ_NO_STATUS(size_t, hasFileDescriptors),
    PARCEL_READ_NO_STATUS(std::vector<android::sp<android::IBinder>>, debugReadAllStrongBinders),
@@ -435,12 +427,6 @@ std::vector<ParcelWrite<::android::Parcel>> BINDER_PARCEL_WRITE_FUNCTIONS {
        int32_t len = provider.ConsumeIntegral<int32_t>();
        p.appendFrom(&p2, start, len);
    },
    [] (::android::Parcel& p, FuzzedDataProvider& provider, android::RandomParcelOptions* /*options*/) {
        FUZZ_LOG() << "about to call setData";
        size_t len = provider.ConsumeIntegralInRange<size_t>(0, 1024);
        std::vector<uint8_t> bytes = provider.ConsumeBytes<uint8_t>(len);
        p.setData(bytes.data(), bytes.size());
    },
    [] (::android::Parcel& p, FuzzedDataProvider& provider, android::RandomParcelOptions* /*options*/) {
        FUZZ_LOG() << "about to call pushAllowFds";
        bool val = provider.ConsumeBool();
@@ -513,10 +499,6 @@ std::vector<ParcelWrite<::android::Parcel>> BINDER_PARCEL_WRITE_FUNCTIONS {
        FUZZ_LOG() << "about to call writeNoException";
        p.writeNoException();
    },
    [] (::android::Parcel& p, FuzzedDataProvider& /* provider */, android::RandomParcelOptions* /*options*/) {
        FUZZ_LOG() << "about to call closeFileDescriptors";
        p.closeFileDescriptors();
    },
    [] (::android::Parcel& p, FuzzedDataProvider& provider, android::RandomParcelOptions* /*options*/) {
        FUZZ_LOG() << "about to call replaceCallingWorkSourceUid";
        uid_t uid = provider.ConsumeIntegral<uid_t>();