11 bool Eq(
const uint8_t *Data,
size_t Size,
const char *Str) {
13 size_t Len = strlen(Str);
14 if (Size < Len)
return false;
15 if (Len >=
sizeof(Buff))
return false;
16 memcpy(Buff, (
char*)Data, Len);
18 int res =
strcmp(Buff, Str);
23 if (
Eq(Data, Size,
"ABC") &&
24 Size >= 3 &&
Eq(Data + 3, Size - 3,
"QWER") &&
25 Size >= 7 &&
Eq(Data + 7, Size - 7,
"ZXCVN") &&
26 Size >= 14 && Data[13] == 42
28 fprintf(stderr,
"BINGO\n");
int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size)
Maximum length of the test input libFuzzer tries to guess a good value based on the corpus and reports it always prefer smaller inputs during the corpus shuffle When libFuzzer itself reports a bug this exit code will be used If indicates the maximal total time in seconds to run the fuzzer minimizes the provided crash input Use with strcmp
bool Eq(const uint8_t *Data, size_t Size, const char *Str)