1 // This file is distributed under the University of Illinois Open Source
2 // License. See LICENSE.TXT for details.
3 
4 // Simple test for a fuzzer. This test may trigger two different bugs.
5 #include <cstddef>
6 #include <cstdint>
7 #include <cstdlib>
8 #include <iostream>
9 
10 static volatile int *Null = 0;
11 
12 void Foo() { Null[1] = 0; }
13 void Bar() { Null[2] = 0; }
14 
15 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
16   if (Size < 10 && Data[0] == 'H')
17     Foo();
18   if (Size >= 10 && Data[0] == 'H')
19     Bar();
20   return 0;
21 }
22 
23