From de2e90a37120f355f8f8fc51d3c8a82f4618c112 Mon Sep 17 00:00:00 2001 From: Lee Smet Date: Fri, 27 Mar 2026 11:14:23 +0100 Subject: [PATCH] Fix message ack bound check Signed-off-by: Lee Smet --- CHANGELOG.md | 1 + mycelium/src/message.rs | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f42abe0..10575cc 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 duplicates to peers. - Make sure the configuration for Quic connections is the same for outbound and inbound connections. +- Fix bound check on message ACK. ## [0.7.4] - 2026-03-23 diff --git a/mycelium/src/message.rs b/mycelium/src/message.rs index b224705..c132ce6 100644 --- a/mycelium/src/message.rs +++ b/mycelium/src/message.rs @@ -359,7 +359,7 @@ where let mc = MessageChunk::new(mp); // Sanity checks. This is just to protect ourselves, if the other party is // malicious it can return any data it wants here. - if mc.chunk_idx() > message.chunks.len() as u64 { + if mc.chunk_idx() >= message.chunks.len() as u64 { debug!("Dropping CHUNK ACK for message because ACK'ed chunk is out of bounds"); return; }