Skip to content

Commit

Permalink
Defend crash due to probable buffer issues while attempting to decode…
Browse files Browse the repository at this point in the history
… u8 (#4)
  • Loading branch information
TilsonJoji authored Nov 7, 2024
1 parent bf830f7 commit b736b9e
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions moq-transport/src/coding/varint.rs
Original file line number Diff line number Diff line change
Expand Up @@ -255,6 +255,7 @@ impl Encode for u8 {

impl Decode for u8 {
fn decode<R: bytes::Buf>(r: &mut R) -> Result<Self, DecodeError> {
Self::decode_remaining(r, 1)?;
Ok(r.get_u8())
}
}
Expand Down

0 comments on commit b736b9e

Please sign in to comment.