1 #include "fuzz_cmn.h"
2
nfcsnoop_capture(NFC_HDR const *,bool)3 void nfcsnoop_capture(NFC_HDR const*, bool){};
delete_stack_non_volatile_store(bool)4 void delete_stack_non_volatile_store(bool){};
debug_nfcsnoop_dump(int)5 void debug_nfcsnoop_dump(int){};
6 std::string nfc_storage_path;
7
8 uint8_t appl_dta_mode_flag = 0;
9 bool nfc_debug_enabled = true;
10
11 #ifdef STANDALONE_FUZZER
main(int argc,char * argv[])12 int main(int argc, char* argv[]) {
13 uint_t iterations = 50;
14 uint_t seed = 0;
15
16 if (argc >= 2) {
17 seed = atol(argv[1]);
18 }
19
20 if (argc >= 3) {
21 iterations = atol(argv[2]);
22 }
23
24 FUZZLOG("iterations=%d, seed=%d", iterations, seed);
25
26 if (0 != LLVMFuzzerInitialize(&argc, &argv)) {
27 return -1;
28 }
29
30 for (auto i = 0; i < iterations; i++) {
31 FUZZLOG("iteration=%d, seed=%d", i, seed);
32 srandom(seed);
33 seed = random();
34 auto data = FuzzSeqGen(3, 255);
35 if (!LLVMFuzzerTestOneInput(&data[0], data.size())) {
36 break;
37 }
38 }
39
40 return 0;
41 }
42 #endif
43