diff options
author | van Hauser <vh@thc.org> | 2020-04-12 10:34:03 +0200 |
---|---|---|
committer | van Hauser <vh@thc.org> | 2020-04-12 10:34:03 +0200 |
commit | eec725a345b2e1cf396fd96970333677f701e42e (patch) | |
tree | e54e1b81503897f6fad14f94c86f69b572befbc2 /test/test-compcov.c | |
parent | fd63344ffc719a478b3bcb164e9f1d2fdf7cb8aa (diff) | |
download | afl++-eec725a345b2e1cf396fd96970333677f701e42e.tar.gz |
add global and local var support to autodictionary
Diffstat (limited to 'test/test-compcov.c')
-rw-r--r-- | test/test-compcov.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/test/test-compcov.c b/test/test-compcov.c index 89611bfb..fff9c759 100644 --- a/test/test-compcov.c +++ b/test/test-compcov.c @@ -3,8 +3,12 @@ #include <unistd.h> #include <string.h> +char global_cmpval[] = "GLOBALVARIABLE"; + int main(int argc, char **argv) { char *input = argv[1], *buf, buffer[20]; + char cmpval[] = "LOCALVARIABLE"; + char shortval[4] = "abc"; if (argc < 2) { ssize_t ret = read(0, buffer, sizeof(buffer) - 1); @@ -24,6 +28,12 @@ int main(int argc, char **argv) { return 0; } else if (*(unsigned int*)input == 0xabadcafe) printf("GG you eat cmp tokens for breakfast!\n"); + else if (memcmp(cmpval, input, 8) == 0) + printf("local var memcmp works!\n"); + else if (memcmp(shortval, input, 4) == 0) + printf("short local var memcmp works!\n"); + else if (memcmp(global_cmpval, input, sizeof(global_cmpval)) == 0) + printf("global var memcmp works!\n"); else printf("I do not know your string\n"); |