Skip to content

Commit

Permalink
Fix panic when receiving malformed push promise with stream id 0
Browse files Browse the repository at this point in the history
  • Loading branch information
seanmonstar committed Dec 9, 2021
1 parent 308663e commit c876dda
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/frame/headers.rs
Original file line number Diff line number Diff line change
Expand Up @@ -400,6 +400,10 @@ impl PushPromise {
let flags = PushPromiseFlag(head.flag());
let mut pad = 0;

if head.stream_id().is_zero() {
return Err(Error::InvalidStreamId);
}

// Read the padding length
if flags.is_padded() {
if src.is_empty() {
Expand Down

0 comments on commit c876dda

Please sign in to comment.