Skip to content

Commit

Permalink
Merge commit from fork
Browse files Browse the repository at this point in the history
Do not panic when decode_integer fails
  • Loading branch information
fasterthanlime authored Nov 3, 2024
2 parents 3d0339d + 6ca3bd9 commit 9a4028e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion crates/loona-hpack/src/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,7 @@ impl<'a> Decoder<'a> {
///
/// Returns the number of octets consumed from the given buffer.
fn update_max_dynamic_size(&mut self, buf: &[u8]) -> Result<usize, DecoderError> {
let (new_size, consumed) = decode_integer(buf, 5).ok().unwrap();
let (new_size, consumed) = decode_integer(buf, 5)?;
if let Some(max_size) = self.max_allowed_table_size {
if new_size > max_size {
return Err(DecoderError::InvalidMaxDynamicSize);
Expand Down

0 comments on commit 9a4028e

Please sign in to comment.