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