code-intelligence.com/cifuzz@v0.40.0/examples/cmake/src/explore_me.cpp (about) 1 #include "explore_me.h" 2 #include <cstdio> 3 #include <cstring> 4 using namespace std; 5 6 // just a function with multiple paths that can be discoverd by a fuzzer 7 void exploreMe(int a, int b, string c) { 8 if (a >= 20000) { 9 if (b >= 2000000) { 10 if (b - a < 100000) { 11 // Trigger the undefined behavior sanitizer 12 int n = 23; 13 n <<= 32; 14 15 if (c == "FUZZING") { 16 // Trigger a heap buffer overflow 17 char *s = (char *)malloc(1); 18 strcpy(s, "too long"); 19 printf("%s\n", s); 20 } 21 } 22 } 23 } 24 }