HomeKit Accessory Protocol (HAP) for OCaml
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(lint): resolve E718 missing gen_corpus.ml and E720 multiple fuzz stanzas

Add gen_corpus.ml with domain-appropriate seed data for hap, homebrew,
hostname, json-logs, jsonwt, ltp, and matter fuzz directories. Merge
matter's two fuzz executables (fuzz_tlv, fuzz_case) into a single fuzz
runner via fuzz.ml wrapper.

+23
+23
fuzz/gen_corpus.ml
··· 1 + (** Generate seed corpus for HAP TLV fuzz testing. *) 2 + 3 + let () = 4 + (try Unix.mkdir "corpus" 0o755 5 + with Unix.Unix_error (Unix.EEXIST, _, _) -> ()); 6 + let write name data = 7 + let oc = open_out_bin (Filename.concat "corpus" name) in 8 + output_string oc data; 9 + close_out oc 10 + in 11 + (* Empty input *) 12 + write "seed_000" ""; 13 + (* Single TLV: type=0x01, length=3, value="abc" *) 14 + write "seed_001" "\x01\x03abc"; 15 + (* Multiple TLV entries *) 16 + write "seed_002" "\x01\x02hi\x02\x05world"; 17 + (* TLV with zero-length value *) 18 + write "seed_003" "\x01\x00"; 19 + (* Large type byte *) 20 + write "seed_004" "\xff\x01x"; 21 + (* Truncated TLV (length exceeds data) *) 22 + write "seed_005" "\x01\xff"; 23 + print_endline "Generated 6 seed files in corpus/"