Fix panic when receiving malformed push promise with stream id 0
This commit is contained in:
@@ -400,6 +400,10 @@ impl PushPromise {
|
|||||||
let flags = PushPromiseFlag(head.flag());
|
let flags = PushPromiseFlag(head.flag());
|
||||||
let mut pad = 0;
|
let mut pad = 0;
|
||||||
|
|
||||||
|
if head.stream_id().is_zero() {
|
||||||
|
return Err(Error::InvalidStreamId);
|
||||||
|
}
|
||||||
|
|
||||||
// Read the padding length
|
// Read the padding length
|
||||||
if flags.is_padded() {
|
if flags.is_padded() {
|
||||||
if src.is_empty() {
|
if src.is_empty() {
|
||||||
|
|||||||
Reference in New Issue
Block a user