Skip to content

Commit

Permalink
fix(fuzz): fix failing fuzzing after pdu encode/decode refactoring
Browse files Browse the repository at this point in the history
  • Loading branch information
pacmancoder committed Mar 21, 2024
1 parent 4da3643 commit fa00ae7
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions crates/ironrdp-pdu/src/ber.rs
Original file line number Diff line number Diff line change
Expand Up @@ -133,6 +133,7 @@ pub(crate) fn read_enumerated(stream: &mut ReadCursor<'_>, count: u8) -> PduResu
return Err(invalid_message_err!("len", "invalid enumerated len"));
}

ensure_size!(in: stream, size: 1);
let enumerated = stream.read_u8();
if enumerated == u8::MAX || enumerated + 1 > count {
return Err(invalid_message_err!("enumerated", "invalid enumerated value"));
Expand Down

0 comments on commit fa00ae7

Please sign in to comment.