add cmplog icmp testcase to CI
diff --git a/test/test-cmplog.c b/test/test-cmplog.c
index 1a31465..d724eca 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 ddbee37..ce64d76 100755
--- a/test/test-llvm.sh
+++ b/test/test-llvm.sh
@@ -261,7 +261,7 @@
$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 )" & {