From: Matt Corallo Date: Tue, 9 Jul 2024 21:08:19 +0000 (+0000) Subject: Rm debug assertions that `read_wire_packet_name` empties its buffer X-Git-Tag: v0.5.5~2 X-Git-Url: http://git.bitcoin.ninja/index.cgi?a=commitdiff_plain;h=4850d035bda869bd5a2e7ddf2f61d24e7dd28ef4;p=dnssec-prover Rm debug assertions that `read_wire_packet_name` empties its buffer These assertions are spurious and reachable when fuzzing, and thus are simply removed. --- diff --git a/src/rr.rs b/src/rr.rs index 0733dd2..a3839d2 100644 --- a/src/rr.rs +++ b/src/rr.rs @@ -401,7 +401,6 @@ impl StaticRecord for CName { } fn read_from_data(name: Name, mut data: &[u8], wire_packet: &[u8]) -> Result { let res = CName { name, canonical_name: read_wire_packet_name(&mut data, wire_packet)? }; - debug_assert!(data.is_empty()); Ok(res) } fn write_u16_len_prefixed_data(&self, out: &mut W) { @@ -432,7 +431,6 @@ impl StaticRecord for DName { } fn read_from_data(name: Name, mut data: &[u8], wire_packet: &[u8]) -> Result { let res = DName { name, delegation_name: read_wire_packet_name(&mut data, wire_packet)? }; - debug_assert!(data.is_empty()); Ok(res) } fn write_u16_len_prefixed_data(&self, out: &mut W) { @@ -877,7 +875,6 @@ impl StaticRecord for NS { } fn read_from_data(name: Name, mut data: &[u8], wire_packet: &[u8]) -> Result { let res = NS { name, name_server: read_wire_packet_name(&mut data, wire_packet)? }; - debug_assert!(data.is_empty()); Ok(res) } fn write_u16_len_prefixed_data(&self, out: &mut W) {