diff options
-rw-r--r-- | test/test-cmplog.c | 8 | ||||
-rwxr-xr-x | test/test-llvm.sh | 2 |
2 files changed, 6 insertions, 4 deletions
diff --git a/test/test-cmplog.c b/test/test-cmplog.c index 1a314653..d724ecaf 100644 --- a/test/test-cmplog.c +++ b/test/test-cmplog.c @@ -8,13 +8,15 @@ int LLVMFuzzerTestOneInput(const uint8_t *buf, size_t i) { - if (i < 24) return 0; + if (i < 30) return 0; if (buf[0] != 'A') return 0; if (buf[1] != 'B') return 0; if (buf[2] != 'C') return 0; if (buf[3] != 'D') return 0; - if (memcmp(buf + 4, "1234", 4) || memcmp(buf + 8, "EFGH", 4)) return 0; - if (strncmp(buf + 12, "IJKL", 4) == 0 && strcmp(buf + 16, "DEADBEEF") == 0) + int *icmp = (int *)(buf + 4); + if (*icmp != 0x69694141) return 0; + if (memcmp(buf + 8, "1234", 4) || memcmp(buf + 12, "EFGH", 4)) return 0; + if (strncmp(buf + 16, "IJKL", 4) == 0 && strcmp(buf + 20, "DEADBEEF") == 0) abort(); return 0; diff --git a/test/test-llvm.sh b/test/test-llvm.sh index ddbee378..ce64d76c 100755 --- a/test/test-llvm.sh +++ b/test/test-llvm.sh @@ -261,7 +261,7 @@ test -e ../afl-clang-fast -a -e ../split-switches-pass.so && { $ECHO "$GREY[*] running afl-fuzz for llvm_mode cmplog, this will take approx 10 seconds" { mkdir -p in - echo 0000000000000000000000000 > in/in + echo 00000000000000000000000000000000 > in/in AFL_BENCH_UNTIL_CRASH=1 ../afl-fuzz -m none -V60 -i in -o out -c./test-cmplog -- ./test-cmplog >>errors 2>&1 } >>errors 2>&1 test -n "$( ls out/default/crashes/id:000000* out/default/hangs/id:000000* 2>/dev/null )" & { |