about summary refs log tree commit diff
path: root/test/test-compcov.c
diff options
context:
space:
mode:
authorvan Hauser <vh@thc.org>2020-04-12 10:34:03 +0200
committervan Hauser <vh@thc.org>2020-04-12 10:34:03 +0200
commiteec725a345b2e1cf396fd96970333677f701e42e (patch)
treee54e1b81503897f6fad14f94c86f69b572befbc2 /test/test-compcov.c
parentfd63344ffc719a478b3bcb164e9f1d2fdf7cb8aa (diff)
downloadafl++-eec725a345b2e1cf396fd96970333677f701e42e.tar.gz
add global and local var support to autodictionary
Diffstat (limited to 'test/test-compcov.c')
-rw-r--r--test/test-compcov.c10
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");