From 757c6d333f07ddfd20c4bf5bdf3f9393174c4116 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Fri, 17 Feb 2023 15:06:09 -0500 Subject: [PATCH] netdoc: Remove a TODO hs comment. It said to check whether C enforces an absence of extraneous bytes at the end of the link specifiers. It does, in `hs_desc.c:decode_link_specifiers()`, where it says: ``` if (link_specifier_list_parse(&specs, decoded, (size_t) decoded_len) < decoded_len) { goto err; } ``` The comparison with "decoded_len" checks whether all the bytes were decoded. --- crates/tor-netdoc/src/doc/hsdesc/inner.rs | 1 - 1 file changed, 1 deletion(-) diff --git a/crates/tor-netdoc/src/doc/hsdesc/inner.rs b/crates/tor-netdoc/src/doc/hsdesc/inner.rs index 4e6b38b9d..64c1dd62b 100644 --- a/crates/tor-netdoc/src/doc/hsdesc/inner.rs +++ b/crates/tor-netdoc/src/doc/hsdesc/inner.rs @@ -166,7 +166,6 @@ impl HsDescInner { let mut r = tor_bytes::Reader::from_slice(ls.as_bytes()); let n = r.take_u8()?; let res = r.extract_n(n.into())?; - // TODO hs: Check whether c tor enforces that this field is exhausted. r.should_be_exhausted()?; res };