From 88a7d56a603e3016cc038c72735f195852861390 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Fri, 25 Aug 2017 23:04:19 -0400 Subject: [PATCH] PRIORITY frames with id 0 are invalid --- src/proto/framed_read.rs | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/proto/framed_read.rs b/src/proto/framed_read.rs index a58d2e5..2e6562b 100644 --- a/src/proto/framed_read.rs +++ b/src/proto/framed_read.rs @@ -150,6 +150,11 @@ impl FramedRead { res.map_err(|_| Connection(ProtocolError))?.into() } Kind::Priority => { + if head.stream_id() == 0 { + // Invalid stream identifier + return Err(Connection(ProtocolError)); + } + match frame::Priority::load(head, &bytes[frame::HEADER_LEN..]) { Ok(frame) => frame.into(), Err(frame::Error::InvalidDependencyId) => {