From 8902a818e1c9e60d1e13c73a73723c1ed77839f0 Mon Sep 17 00:00:00 2001 From: Fabian Meumertzheim Date: Sun, 30 May 2021 13:14:45 +0200 Subject: Let ExampleFuzzerWithNative crash with ASan report --- examples/src/main/native/com_example_ExampleFuzzerWithNative.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'examples') diff --git a/examples/src/main/native/com_example_ExampleFuzzerWithNative.cpp b/examples/src/main/native/com_example_ExampleFuzzerWithNative.cpp index 04329acc..434c3d5b 100644 --- a/examples/src/main/native/com_example_ExampleFuzzerWithNative.cpp +++ b/examples/src/main/native/com_example_ExampleFuzzerWithNative.cpp @@ -18,11 +18,11 @@ // simple function containing a crash that requires coverage and string compare // instrumentation for the fuzzer to find -void parseInternal(const std::string &input) { +__attribute__((optnone)) void parseInternal(const std::string &input) { if (input[0] == 'a' && input[1] == 'b' && input[5] == 'c') { if (input.find("secret_in_native_library") != std::string::npos) { // BOOM - *(char *)1 = 2; + [[maybe_unused]] char foo = input[input.size() + 2]; } } } -- cgit v1.2.3