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

Commit 60c292a5 authored by Steven Moreland's avatar Steven Moreland Committed by Automerger Merge Worker
Browse files

Merge "binder_rpc_fuzzer: limit connections" am: 13934429

parents 38052352 13934429
Loading
Loading
Loading
Loading
+6 −1
Original line number Diff line number Diff line
@@ -133,8 +133,13 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {

    bool hangupBeforeShutdown = provider.ConsumeBool();

    // b/260736889 - limit arbitrarily, due to thread resource exhaustion, which currently
    // aborts. Servers should consider RpcServer::setConnectionFilter instead.
    constexpr size_t kMaxConnections = 1000;

    while (provider.remaining_bytes() > 0) {
        if (connections.empty() || provider.ConsumeBool()) {
        if (connections.empty() ||
            (connections.size() < kMaxConnections && provider.ConsumeBool())) {
            base::unique_fd fd(TEMP_FAILURE_RETRY(socket(AF_UNIX, SOCK_STREAM | SOCK_CLOEXEC, 0)));
            CHECK_NE(fd.get(), -1);
            CHECK_EQ(0,