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

Commit fd5e2e11 authored by Steven Moreland's avatar Steven Moreland
Browse files

record file fuzzer: fix FD double-own

How this bug was not filed earlier is beyond my
imagination.

Fixes: 306847496
Test: binder_recordedTransactionFileFuzz
Change-Id: If1da3ecf31b3310e1542bc519b4b6890298db242
parent 2de74ac2
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -35,7 +35,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
    if (transaction.has_value()) {
        intermediateFile = std::tmpfile();

        android::base::unique_fd fdForWriting(fileno(intermediateFile));
        android::base::unique_fd fdForWriting(dup(fileno(intermediateFile)));
        auto writeStatus ATTRIBUTE_UNUSED = transaction.value().dumpToFile(fdForWriting);

        std::fclose(intermediateFile);