From d8573b69aa7f14f288927d9541b0dea495d747c9 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Tue, 9 Jul 2024 20:32:39 +0000 Subject: [PATCH] Call `RR.json()` when deserializing RRs in fuzzing To improve coverage --- src/ser.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) 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) } -- 2.39.5