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

Commit 1420afd9 authored by Fabián Cañas's avatar Fabián Cañas
Browse files

Fix double close in RecordedTransaction fuzzer

BUG=271692937

Test: The issue is reproducible on devices with HWASan:

SANITIZE_TARGET=hwaddress make binder_recordedTransactionFileFuzz
$ cd ${ANDROID_PRODUCT_OUT}
$ adb root
$ adb sync data
$ adb shell /data/fuzz/$(get_build_var
TARGET_ARCH)/binder_recordedTransactionFileFuzz/binder_recordedTransactionFileFuzz

Without the fix, fdsan fails immediately. With the fix, the fuzzer runs
successfully.

Change-Id: I3972fa0b3d9e56eef001a6c5be8c9beab77571d7
parent 19ce0cba
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -26,7 +26,7 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {
    rewind(intermediateFile);
    int fileNumber = fileno(intermediateFile);

    android::base::unique_fd fd(fileNumber);
    android::base::unique_fd fd(dup(fileNumber));

    auto transaction = android::binder::debug::RecordedTransaction::fromFile(fd);