From 4850d035bda869bd5a2e7ddf2f61d24e7dd28ef4 Mon Sep 17 00:00:00 2001 From: Matt Corallo Date: Tue, 9 Jul 2024 21:08:19 +0000 Subject: [PATCH] Rm debug assertions that `read_wire_packet_name` empties its buffer These assertions are spurious and reachable when fuzzing, and thus are simply removed. --- src/rr.rs | 3 --- 1 file changed, 3 deletions(-) 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) { -- 2.39.5