authorbors <bors@rust-lang.org> 2026-06-28 08:01:34 UTC
committerbors <bors@rust-lang.org> 2026-06-28 08:01:34 UTC
log11823209557bba4f6acb520109c63aa78c041683
tree669241797c897c36e1969dc0e4553bc1a1ed9ff7
parentfd07dbfc91b7b6b3fa76d957e130c51e654131ee
parent53cc2f81d4533150ad42b75533362ca599c36303

Auto merge of #158457 - devnexen:xous_ipv6_fix, r=joboet

std: fix xous dns ipv6 parsing off-by-one the ipv6 arm read the 16-byte address from offset+1 instead of offset, unlike the ipv4 arm. this mis-parsed every ipv6 result and let the slice reach offset+17 while the bounds check only guards offset+16, so a malformed dns response could index past the 4096-byte buffer and panic.

1 files changed, 2 insertions(+), 3 deletions(-)

library/std/src/sys/net/connection/xous/dns.rs+2-3
......@@ -43,9 +43,8 @@ impl Iterator for LookupHost {
4343 return None;
4444 }
4545 let mut new_addr = [0u8; 16];
46 for (src, octet) in self.data.0[(self.offset + 1)..(self.offset + 16 + 1)]
47 .iter()
48 .zip(new_addr.iter_mut())
46 for (src, octet) in
47 self.data.0[self.offset..(self.offset + 16)].iter().zip(new_addr.iter_mut())
4948 {
5049 *octet = *src;
5150 }