From: Matt Corallo Date: Tue, 9 Jul 2024 20:32:39 +0000 (+0000) Subject: Call `RR.json()` when deserializing RRs in fuzzing X-Git-Tag: v0.5.5~4 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=d8573b69aa7f14f288927d9541b0dea495d747c9;p=dnssec-prover Call `RR.json()` when deserializing RRs in fuzzing To improve coverage --- diff --git a/src/ser.rs b/src/ser.rs index 3cb3c89..30ab302 100644 --- a/src/ser.rs +++ b/src/ser.rs @@ -173,7 +173,10 @@ pub(crate) fn parse_rr(inp: &mut &[u8]) -> Result { pub fn parse_rr_stream(mut inp: &[u8]) -> Result, ()> { let mut res = Vec::with_capacity(32); while !inp.is_empty() { - res.push(parse_rr(&mut inp)?); + let rr = parse_rr(&mut inp)?; + #[cfg(fuzzing)] + let _ = rr.json(); // Make sure we can JSON the RR when fuzzing, cause why not + res.push(rr); } Ok(res) }