diff options
author | richinseattle@gmail.com <richinseattle@gmail.com> | 2021-03-18 01:37:40 -0700 |
---|---|---|
committer | richinseattle@gmail.com <richinseattle@gmail.com> | 2021-03-18 01:37:40 -0700 |
commit | c397becd81229d71b55acf89a31710bead3707aa (patch) | |
tree | 8306b59e88e22d7090fd786690227dacc99e24e3 /test/test-cmplog.c | |
parent | 62508c3b446a893f0afead9a6d0546d53d588a13 (diff) | |
parent | 94312796f936ba1830b61432a0f958e192dd212f (diff) | |
download | afl++-c397becd81229d71b55acf89a31710bead3707aa.tar.gz |
Merge branch 'dev' of https://github.com/AFLplusplus/AFLplusplus into dev
Diffstat (limited to 'test/test-cmplog.c')
-rw-r--r-- | test/test-cmplog.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/test/test-cmplog.c b/test/test-cmplog.c new file mode 100644 index 00000000..b077e3ab --- /dev/null +++ b/test/test-cmplog.c @@ -0,0 +1,23 @@ +#include <stdio.h> +#include <string.h> +#include <stdarg.h> +#include <stdlib.h> +#include <stdint.h> +#include <unistd.h> +int main(int argc, char *argv[]) { + + char buf[1024]; + ssize_t i; + if ((i = read(0, buf, sizeof(buf) - 1)) < 24) return 0; + buf[i] = 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) + abort(); + return 0; + +} + |