diff --git a/fuzz/Cargo.toml b/fuzz/Cargo.toml index d6f11f8e0..5ef91d949 100644 --- a/fuzz/Cargo.toml +++ b/fuzz/Cargo.toml @@ -30,6 +30,10 @@ path = "fuzz_targets/compile_taproot.rs" name = "parse_descriptor" path = "fuzz_targets/parse_descriptor.rs" +[[bin]] +name = "parse_descriptor_priv" +path = "fuzz_targets/parse_descriptor_priv.rs" + [[bin]] name = "parse_descriptor_secret" path = "fuzz_targets/parse_descriptor_secret.rs" diff --git a/fuzz/fuzz_targets/parse_descriptor_priv.rs b/fuzz/fuzz_targets/parse_descriptor_priv.rs new file mode 100644 index 000000000..98bfb992c --- /dev/null +++ b/fuzz/fuzz_targets/parse_descriptor_priv.rs @@ -0,0 +1,23 @@ +#![allow(unexpected_cfgs)] + +use honggfuzz::fuzz; +use miniscript::bitcoin::secp256k1; +use miniscript::Descriptor; + +fn do_test(data: &[u8]) { + let data_str = String::from_utf8_lossy(data); + let secp = &secp256k1::Secp256k1::signing_only(); + + if let Ok((desc, _)) = Descriptor::parse_descriptor(secp, &data_str) { + let _output = desc.to_string(); + let _sanity_check = desc.sanity_check(); + } +} + +fn main() { + loop { + fuzz!(|data| { + do_test(data); + }); + } +}