From 7f68de32c60769c3d3217e5cec68ac68e6b97a0a Mon Sep 17 00:00:00 2001 From: Mike McTernan Date: Fri, 22 Jul 2022 09:28:07 +0100 Subject: [PATCH] ANDROID: fuzz: Rename libfdt_fuzzer.cpp to .c Change cpp to c file ahead of further extensions to the fuzzing test harness. This simplifies building afl-fuzz or with just C tools, but could be made C++ again if needed in the future. Test: build and ran libFuzzer test Change-Id: Ibc7edc8834fa71d4bbabac826efccb49d8a1be38 Merged-In: I8873883ab5b91f36b707cd9d05856aa4c9c222bd --- fuzzing/Android.bp | 2 +- fuzzing/{libfdt_fuzzer.cpp => libfdt_fuzzer.c} | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) rename fuzzing/{libfdt_fuzzer.cpp => libfdt_fuzzer.c} (94%) diff --git a/fuzzing/Android.bp b/fuzzing/Android.bp index a9c27e3..09b1f4a 100644 --- a/fuzzing/Android.bp +++ b/fuzzing/Android.bp @@ -6,7 +6,7 @@ package { cc_fuzz { name: "libfdt_fuzzer", srcs: [ - "libfdt_fuzzer.cpp", + "libfdt_fuzzer.c", ], static_libs: [ "libfdt", diff --git a/fuzzing/libfdt_fuzzer.cpp b/fuzzing/libfdt_fuzzer.c similarity index 94% rename from fuzzing/libfdt_fuzzer.cpp rename to fuzzing/libfdt_fuzzer.c index 64ecc33..227e711 100644 --- a/fuzzing/libfdt_fuzzer.cpp +++ b/fuzzing/libfdt_fuzzer.c @@ -29,7 +29,7 @@ void walk_device_tree(const void *device_tree, int parent_node) { // Information on device tree is available in external/dtc/Documentation/ // folder. -extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { +int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { // Non-zero return values are reserved for future use. if (size < FDT_V17_SIZE) return 0; @@ -39,4 +39,4 @@ extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) { walk_device_tree(data, root_node_offset); return 0; -} \ No newline at end of file +}