aboutsummaryrefslogtreecommitdiff
path: root/infra/cifuzz/test_files/external-project/do_stuff_fuzzer.cpp
diff options
context:
space:
mode:
authorjonathanmetzman <31354670+jonathanmetzman@users.noreply.github.com>2020-12-07 10:50:11 -0800
committerGitHub <noreply@github.com>2020-12-07 10:50:11 -0800
commitb0b99d5ccdf5e2e49cfe3138fbcf64e6fef6ea7f (patch)
tree4afa704c82330c785a468ecfe5097314e7b06365 /infra/cifuzz/test_files/external-project/do_stuff_fuzzer.cpp
parenta24cebec02a0c97247bef31963d5f5fadbaa4ebf (diff)
downloadoss-fuzz-b0b99d5ccdf5e2e49cfe3138fbcf64e6fef6ea7f.tar.gz
Cifuzz external build (#4656)
* Support building fuzzers for projects outside of OSS-Fuzz * Use retry wrapper * Fix some tests.
Diffstat (limited to 'infra/cifuzz/test_files/external-project/do_stuff_fuzzer.cpp')
-rw-r--r--infra/cifuzz/test_files/external-project/do_stuff_fuzzer.cpp24
1 files changed, 24 insertions, 0 deletions
diff --git a/infra/cifuzz/test_files/external-project/do_stuff_fuzzer.cpp b/infra/cifuzz/test_files/external-project/do_stuff_fuzzer.cpp
new file mode 100644
index 000000000..71fa8cae2
--- /dev/null
+++ b/infra/cifuzz/test_files/external-project/do_stuff_fuzzer.cpp
@@ -0,0 +1,24 @@
+// Copyright 2020 Google LLC
+//
+// Licensed under the Apache License, Version 2.0 (the "License");
+// you may not use this file except in compliance with the License.
+// You may obtain a copy of the License at
+//
+// http://www.apache.org/licenses/LICENSE-2.0
+//
+// Unless required by applicable law or agreed to in writing, software
+// distributed under the License is distributed on an "AS IS" BASIS,
+// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+// See the License for the specific language governing permissions and
+// limitations under the License.
+#include "my_api.h"
+
+#include <string>
+
+// Simple fuzz target for DoStuff().
+// See http://libfuzzer.info for details.
+extern "C" int LLVMFuzzerTestOneInput(const uint8_t *data, size_t size) {
+ std::string str(reinterpret_cast<const char *>(data), size);
+ DoStuff(str); // Disregard the output.
+ return 0;
+}