diff options
author | vanhauser-thc <vh@thc.org> | 2023-05-17 15:25:26 +0200 |
---|---|---|
committer | vanhauser-thc <vh@thc.org> | 2023-05-17 15:25:26 +0200 |
commit | 1d0694df86a3ce70ffac2846f36605eac9300abe (patch) | |
tree | c77f4514b2dd1026a245ccd38f8e2683cad0aa63 /test-instr.c | |
parent | dfdc6fd12cdae1fe2dab1183f20d3c312a7f2f6d (diff) | |
download | afl++-1d0694df86a3ce70ffac2846f36605eac9300abe.tar.gz |
add symqemu custom mutator
Diffstat (limited to 'test-instr.c')
-rw-r--r-- | test-instr.c | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/test-instr.c b/test-instr.c index 1d9f2e6e..eda5189c 100644 --- a/test-instr.c +++ b/test-instr.c @@ -24,7 +24,7 @@ int main(int argc, char **argv) { - int fd = 0; + int fd = 0, cnt; char buff[8]; char *buf = buff; @@ -32,7 +32,6 @@ int main(int argc, char **argv) { if (argc == 2) { buf = argv[1]; - printf("Input %s - ", buf); } else { @@ -47,15 +46,19 @@ int main(int argc, char **argv) { } - if (read(fd, buf, sizeof(buf)) < 1) { + if ((cnt = read(fd, buf, sizeof(buf) - 1)) < 1) { printf("Hum?\n"); return 1; } + buf[cnt] = 0; + } + if (getenv("AFL_DEBUG")) fprintf(stderr, "test-instr: %s\n", buf); + // we support three input cases (plus a 4th if stdin is used but there is no // input) switch (buf[0]) { |