Reject trailing bytes in protocol packets
ci / test (push) Canceled after 0s
ci / fuzz-smoke (push) Canceled after 0s
ci / windows-client (push) Canceled after 0s
ci / package-release (linux-x86_64, ubuntu-latest) (push) Canceled after 0s
ci / package-release (macos-aarch64, macos-14) (push) Canceled after 0s
ci / package-release (macos-x86_64, macos-13) (push) Canceled after 0s
ci / package-release (windows-x86_64, windows-latest) (push) Canceled after 0s
ci / remote-bench (push) Canceled after 0s
ci / publish-gitea-release (push) Canceled after 0s

This commit is contained in:
DuProcess
2026-07-12 23:42:00 -04:00
parent e67e06ebb5
commit 7ebc6533a7
2 changed files with 18 additions and 0 deletions
+3
View File
@@ -273,6 +273,9 @@ pub fn decode(input: &[u8]) -> Result<Packet> {
if input.len() < end {
bail!("truncated packet body");
}
if input.len() > end {
bail!("trailing packet bytes");
}
Ok(Packet {
header,
body: input[HEADER_LEN..end].to_vec(),