Skip to content

Commit c876dda

Browse files
committed
Fix panic when receiving malformed push promise with stream id 0
1 parent 308663e commit c876dda

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/frame/headers.rs

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -400,6 +400,10 @@ impl PushPromise {
400400
let flags = PushPromiseFlag(head.flag());
401401
let mut pad = 0;
402402

403+
if head.stream_id().is_zero() {
404+
return Err(Error::InvalidStreamId);
405+
}
406+
403407
// Read the padding length
404408
if flags.is_padded() {
405409
if src.is_empty() {

0 commit comments

Comments
 (0)