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

Commit 8a2607c4 authored by Steven Moreland's avatar Steven Moreland
Browse files

libbinder_random_parcel: hide fill parcel data

We have no external users of this function, and I'd generally
recommend against using it (it doesn't test things in RPC mode
currently, and it limits the branches that would be explored).
Hiding it for now.

Bug: 224646709
Test: run binder_parcel_fuzzer
Change-Id: Iafb61b9e201861f2f87de2f99217294b0d532881
parent c572d08c
Loading
Loading
Loading
Loading
+0 −4
Original line number Diff line number Diff line
@@ -24,8 +24,4 @@ namespace android {
 * Fill parcel data, including some random binder objects and FDs
 */
void fillRandomParcel(Parcel* p, FuzzedDataProvider&& provider);
/**
 * Fill parcel data, but don't fill any objects.
 */
void fillRandomParcelData(Parcel* p, FuzzedDataProvider&& provider);
} // namespace android
+5 −5
Original line number Diff line number Diff line
@@ -34,6 +34,11 @@ private:
    String16 mDescriptor;
};

static void fillRandomParcelData(Parcel* p, FuzzedDataProvider&& provider) {
    std::vector<uint8_t> data = provider.ConsumeBytes<uint8_t>(provider.remaining_bytes());
    CHECK(OK == p->write(data.data(), data.size()));
}

void fillRandomParcel(Parcel* p, FuzzedDataProvider&& provider) {
    if (provider.ConsumeBool()) {
        auto session = RpcSession::make(RpcTransportCtxFactoryRaw::make());
@@ -85,9 +90,4 @@ void fillRandomParcel(Parcel* p, FuzzedDataProvider&& provider) {
    }
}

void fillRandomParcelData(Parcel* p, FuzzedDataProvider&& provider) {
    std::vector<uint8_t> data = provider.ConsumeBytes<uint8_t>(provider.remaining_bytes());
    CHECK(OK == p->write(data.data(), data.size()));
}

} // namespace android