File tree Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Expand file tree Collapse file tree 1 file changed +8
-6
lines changed Original file line number Diff line number Diff line change 2929#include < utility>
3030#include < vector>
3131
32+ #ifdef __AFL_FUZZ_INIT
33+ __AFL_FUZZ_INIT ();
34+ #endif
35+
3236const std::function<void (const std::string&)> G_TEST_LOG_FUN{};
3337
3438/* *
@@ -188,7 +192,7 @@ int main(int argc, char** argv)
188192{
189193 initialize ();
190194 static const auto & test_one_input = *Assert (g_test_one_input);
191- #ifdef __AFL_INIT
195+ #ifdef __AFL_HAVE_MANUAL_CONTROL
192196 // Enable AFL deferred forkserver mode. Requires compilation using
193197 // afl-clang-fast++. See fuzzing.md for details.
194198 __AFL_INIT ();
@@ -197,12 +201,10 @@ int main(int argc, char** argv)
197201#ifdef __AFL_LOOP
198202 // Enable AFL persistent mode. Requires compilation using afl-clang-fast++.
199203 // See fuzzing.md for details.
204+ const uint8_t * buffer = __AFL_FUZZ_TESTCASE_BUF;
200205 while (__AFL_LOOP (1000 )) {
201- std::vector<uint8_t > buffer;
202- if (!read_stdin (buffer)) {
203- continue ;
204- }
205- test_one_input (buffer);
206+ size_t buffer_len = __AFL_FUZZ_TESTCASE_LEN;
207+ test_one_input ({buffer, buffer_len});
206208 }
207209#else
208210 std::vector<uint8_t > buffer;
You can’t perform that action at this time.
0 commit comments