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_plant.om
| 1 | note SPDX-License-Identifier: Apache-2.0 |
| 2 | note fz_plant.om: NEGATIVE CONTROL, never shipped. fz_dns plus a planted defect: input bytes 1..4 |
| 3 | note equal to "OMFZ" make main write past a 4-byte array, a bounds trap (exit 103). Each byte is its |
| 4 | note own branch, so a coverage-guided fuzzer climbs to it one byte at a time; a blind fuzzer needs about |
| 5 | note 2^32 tries. The campaign must report this crash, or its crash detection is not trusted. |
| 6 | |
| 7 | fn fz_plt in view uchar * n ulong ip edit uchar * to void |
| 8 | if lt n 5 |
| 9 | ret |
| 10 | end |
| 11 | if eq get in 1 79 |
| 12 | if eq get in 2 77 |
| 13 | if eq get in 3 70 |
| 14 | if eq get in 4 90 |
| 15 | put ip add n 4 0 |
| 16 | end |
| 17 | end |
| 18 | end |
| 19 | end |
| 20 | end |
| 21 | |
| 22 | fn main to int |
| 23 | ip = new uchar 4 0 |
| 24 | in = new uchar FZCAP 0 |
| 25 | n = fz_read in |
| 26 | fz_plt view in n ip |
| 27 | if lt n 2 |
| 28 | ret 0 |
| 29 | end |
| 30 | if eq and get in 0 1 1 |
| 31 | fz_dnsconf part in 1 sub n 1 ip |
| 32 | ret 0 |
| 33 | end |
| 34 | fz_dnsq part in 1 sub n 1 |
| 35 | ret 0 |
| 36 | end |