omega-mv
Omega: a language for verified programs, semantic identity and machine realization. Seed-born work and existing implementations have distinct provenance.
Brought by drakestapleton
omega-mv / om / tls / test / fuzz / fz_dns.om
| 1 | note SPDX-License-Identifier: Apache-2.0 |
| 2 | note fz_dns.om: fuzz target for the DNS code of om/tls/tls.om (dns_query, dns_parse with its name |
| 3 | note skipping, CNAME chains and owner checks; dns_cfgbyte / dns_cfgend / dns_ip4, the resolv.conf parser). |
| 4 | note Input: M rest. M odd: rest is resolv.conf text for the live streaming parser. M even: rest = H name[H] response, |
| 5 | note the response to dns_query(name, id 0x4f4d); a name dns_query refuses falls back to FZHOST. |
| 6 | |
| 7 | fn main to int |
| 8 | ip = new uchar 4 0 |
| 9 | in = new uchar FZCAP 0 |
| 10 | n = fz_read in |
| 11 | if lt n 2 |
| 12 | ret 0 |
| 13 | end |
| 14 | if eq and get in 0 1 1 |
| 15 | fz_dnsconf part in 1 sub n 1 ip |
| 16 | ret 0 |
| 17 | end |
| 18 | fz_dnsq part in 1 sub n 1 |
| 19 | ret 0 |
| 20 | end |