Skip to content

Commit fdb139d

Browse files
kixelatedclaude
andauthored
Fix spurious "short buffer" warnings during message decode (#1223)
Co-authored-by: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
1 parent b6369d9 commit fdb139d

2 files changed

Lines changed: 6 additions & 0 deletions

File tree

rs/moq-lite/src/ietf/message.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,9 @@ impl<T: Message> Decode<Version> for T {
5252
}
5353
}
5454
} else {
55+
if buf.remaining() < size {
56+
return Err(DecodeError::Short);
57+
}
5558
let mut limited = buf.take(size);
5659
match Self::decode_msg(&mut limited, version) {
5760
Ok(result) => {

rs/moq-lite/src/lite/message.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ impl<T: Message> Decode<Version> for T {
4949
}
5050
}
5151
} else {
52+
if buf.remaining() < size {
53+
return Err(DecodeError::Short);
54+
}
5255
let mut limited = buf.take(size);
5356
match Self::decode_msg(&mut limited, version) {
5457
Ok(result) => {

0 commit comments

Comments
 (0)