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_nci_reset_keep_cfg_enabled = false;
11 uint8_t nfc_nci_reset_type = 0x00;
12 
13 namespace android {
14 namespace util {
stats_write(int32_t,...)15 void stats_write(int32_t, ...) {}
16 }  // namespace util
17 }  // namespace android
18 
19 #ifdef STANDALONE_FUZZER
main(int argc,char * argv[])20 int main(int argc, char* argv[]) {
21   uint_t iterations = 50;
22   uint_t seed = 0;
23 
24   if (argc >= 2) {
25     seed = atol(argv[1]);
26   }
27 
28   if (argc >= 3) {
29     iterations = atol(argv[2]);
30   }
31 
32   FUZZLOG("iterations=%d, seed=%d", iterations, seed);
33 
34   if (0 != LLVMFuzzerInitialize(&argc, &argv)) {
35     return -1;
36   }
37 
38   for (auto i = 0; i < iterations; i++) {
39     FUZZLOG("iteration=%d, seed=%d", i, seed);
40     srandom(seed);
41     seed = random();
42     auto data = FuzzSeqGen(3, 255);
43     if (!LLVMFuzzerTestOneInput(&data[0], data.size())) {
44       break;
45     }
46   }
47 
48   return 0;
49 }
50 #endif
51