From 38900df185a27380c09cb74f4748b3d364a6b7d1 Mon Sep 17 00:00:00 2001 From: Sean McArthur Date: Thu, 5 Oct 2017 17:09:20 -0700 Subject: [PATCH] reset stream if invalid content-length received --- src/proto/streams/recv.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/proto/streams/recv.rs b/src/proto/streams/recv.rs index ba983b5..37cd156 100644 --- a/src/proto/streams/recv.rs +++ b/src/proto/streams/recv.rs @@ -152,9 +152,10 @@ where if let Some(content_length) = frame.fields().get(header::CONTENT_LENGTH) { let content_length = match parse_u64(content_length.as_bytes()) { Ok(v) => v, - Err(_) => { - unimplemented!(); - }, + Err(_) => return Err(RecvError::Stream { + id: stream.id, + reason: Reason::ProtocolError, + }), }; stream.content_length = ContentLength::Remaining(content_length);