aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDavide Quarta <quarta@qti.qualcomm.com>2024-02-06 14:00:37 +0100
committerDavide Quarta <quarta@qti.qualcomm.com>2024-02-06 14:00:37 +0100
commit58aa181d012698471d003983aaf9e67cf92961d2 (patch)
treee70b110a5164101d7605e0b1921629a4b2579e2e
parent023fc19ce04bffcbd623e27a1f2d1810c3ec0c3c (diff)
downloadAFLplusplus-58aa181d012698471d003983aaf9e67cf92961d2.tar.gz
revert persistent_demo_new.c to b99bbf671b7469a5aad29898fe28489004c4cbe7
-rw-r--r--utils/persistent_mode/persistent_demo_new.c13
1 files changed, 11 insertions, 2 deletions
diff --git a/utils/persistent_mode/persistent_demo_new.c b/utils/persistent_mode/persistent_demo_new.c
index 3d9d90a6..285f50aa 100644
--- a/utils/persistent_mode/persistent_demo_new.c
+++ b/utils/persistent_mode/persistent_demo_new.c
@@ -31,8 +31,17 @@
/* this lets the source compile without afl-clang-fast/lto */
#ifndef __AFL_FUZZ_TESTCASE_LEN
- #define AFL_COMPAT
- #include "persistent_replay.h"
+
+ssize_t fuzz_len;
+unsigned char fuzz_buf[1024000];
+
+ #define __AFL_FUZZ_TESTCASE_LEN fuzz_len
+ #define __AFL_FUZZ_TESTCASE_BUF fuzz_buf
+ #define __AFL_FUZZ_INIT() void sync(void);
+ #define __AFL_LOOP(x) \
+ ((fuzz_len = read(0, fuzz_buf, sizeof(fuzz_buf))) > 0 ? 1 : 0)
+ #define __AFL_INIT() sync()
+
#endif
__AFL_FUZZ_INIT();