diff --git a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Stream.java b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Stream.java index f8360ab0d09..3262d94e9a5 100644 --- a/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Stream.java +++ b/jetty-http2/http2-common/src/main/java/org/eclipse/jetty/http2/HTTP2Stream.java @@ -320,7 +320,7 @@ public class HTTP2Stream extends IdleTimeout implements IStream, Callback, Dumpa if (dataLength != Long.MIN_VALUE) { dataLength -= frame.remaining(); - if (frame.isEndStream() && dataLength != 0) + if (dataLength < 0 || (frame.isEndStream() && dataLength != 0)) { reset(new ResetFrame(streamId, ErrorCode.PROTOCOL_ERROR.code), Callback.NOOP); callback.failed(new IOException("invalid_data_length"));