This is an automated email from the ASF dual-hosted git repository. markt pushed a commit to branch 8.5.x in repository https://gitbox.apache.org/repos/asf/tomcat.git
commit a9efebdeb37fdcadec7c5b9559cbc09bcff0b7c8 Author: Mark Thomas <ma...@apache.org> AuthorDate: Wed Jul 24 14:22:05 2019 +0100 Fix h2spec test suite failure. EOS in Huffman encoded string literal. Patch by jfclere --- java/org/apache/coyote/http2/HPackHuffman.java | 5 +++++ java/org/apache/coyote/http2/LocalStrings.properties | 1 + webapps/docs/changelog.xml | 4 ++++ 3 files changed, 10 insertions(+) diff --git a/java/org/apache/coyote/http2/HPackHuffman.java b/java/org/apache/coyote/http2/HPackHuffman.java index 637e690..365a6f9 100644 --- a/java/org/apache/coyote/http2/HPackHuffman.java +++ b/java/org/apache/coyote/http2/HPackHuffman.java @@ -404,6 +404,11 @@ public class HPackHuffman { if ((val & HIGH_TERMINAL_BIT) == 0) { treePos = (val >> 16) & LOW_MASK; } else { + if (eosBitCount != 0) { + // This must be the EOS symbol which MUST be treated + // as an error + throw new HpackException(sm.getString("hpackhuffman.stringLiteralEOS")); + } target.append((char) ((val >> 16) & LOW_MASK)); treePos = 0; eosBits = true; diff --git a/java/org/apache/coyote/http2/LocalStrings.properties b/java/org/apache/coyote/http2/LocalStrings.properties index e371865..b4f9925 100644 --- a/java/org/apache/coyote/http2/LocalStrings.properties +++ b/java/org/apache/coyote/http2/LocalStrings.properties @@ -44,6 +44,7 @@ hpackdecoder.tableSizeUpdateNotAtStart=Any table size update must be sent at the hpackdecoder.zeroNotValidHeaderTableIndex=Zero is not a valid header table index hpackhuffman.huffmanEncodedHpackValueDidNotEndWithEOS=Huffman encoded value in HPACK headers did not end with EOS padding +hpackhuffman.stringLiteralEOS=Huffman encoded value in HPACK headers contained the EOS symbol hpackhuffman.stringLiteralTooMuchPadding=More than 7 bits of EOS padding were provided at the end of an Huffman encoded string literal http2Parser.headerLimitCount=Connection [{0}], Stream [{1}], Too many headers diff --git a/webapps/docs/changelog.xml b/webapps/docs/changelog.xml index 624a4e0..8416e8a 100644 --- a/webapps/docs/changelog.xml +++ b/webapps/docs/changelog.xml @@ -93,6 +93,10 @@ <bug>63578</bug>: Improve handling of invalid requests so that 400 responses are returned to the client rather than 500 responses. (markt) </fix> + <fix> + Fix h2spec test suite failure. It is an error if a Huffman encoded + string literal contains the EOS symbol. (jfclere) + </fix> </changelog> </subsection> <subsection name="Other"> --------------------------------------------------------------------- To unsubscribe, e-mail: dev-unsubscr...@tomcat.apache.org For additional commands, e-mail: dev-h...@tomcat.apache.org