]> git.proxmox.com Git - ceph.git/blob - ceph/src/jaegertracing/opentelemetry-cpp/third_party/nlohmann-json/test/thirdparty/Fuzzer/test/ShrinkControlFlowTest.cpp
update ceph source to reef 18.1.2
[ceph.git] / ceph / src / jaegertracing / opentelemetry-cpp / third_party / nlohmann-json / test / thirdparty / Fuzzer / test / ShrinkControlFlowTest.cpp
1 // This file is distributed under the University of Illinois Open Source
2 // License. See LICENSE.TXT for details.
3
4 // Test that we can find the minimal item in the corpus (3 bytes: "FUZ").
5 #include <cstdint>
6 #include <cstdlib>
7 #include <cstddef>
8 #include <cstring>
9 #include <cstdio>
10
11 static volatile int Sink;
12
13 extern "C" int LLVMFuzzerTestOneInput(const uint8_t *Data, size_t Size) {
14 int8_t Ids[256];
15 memset(Ids, -1, sizeof(Ids));
16 for (size_t i = 0; i < Size; i++)
17 if (Ids[Data[i]] == -1)
18 Ids[Data[i]] = i;
19 int F = Ids[(unsigned char)'F'];
20 int U = Ids[(unsigned char)'U'];
21 int Z = Ids[(unsigned char)'Z'];
22 if (F >= 0 && U > F && Z > U) {
23 Sink++;
24 //fprintf(stderr, "IDS: %d %d %d\n", F, U, Z);
25 }
26 return 0;
27 }
28