Repository: trafficserver Updated Branches: refs/heads/master fc77df964 -> 7dbb358c9
TS-3847: Check if table size updates are at the beginning of the block This closes #333 Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/7dbb358c Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/7dbb358c Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/7dbb358c Branch: refs/heads/master Commit: 7dbb358c95ec661de7cdfad5ceefbef0a9c0e2e5 Parents: fc77df9 Author: Masakazu Kitajo <[email protected]> Authored: Sat Nov 14 12:42:02 2015 -0800 Committer: Bryan Call <[email protected]> Committed: Sat Nov 14 12:42:02 2015 -0800 ---------------------------------------------------------------------- proxy/http2/HTTP2.cc | 6 ++++++ 1 file changed, 6 insertions(+) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/trafficserver/blob/7dbb358c/proxy/http2/HTTP2.cc ---------------------------------------------------------------------- diff --git a/proxy/http2/HTTP2.cc b/proxy/http2/HTTP2.cc index ce10d62..16a72fa 100644 --- a/proxy/http2/HTTP2.cc +++ b/proxy/http2/HTTP2.cc @@ -584,6 +584,7 @@ http2_decode_header_blocks(HTTPHdr *hdr, const uint8_t *buf_start, const uint8_t const uint8_t *cursor = buf_start; HdrHeap *heap = hdr->m_heap; HTTPHdrImpl *hh = hdr->m_http; + bool header_field_started = false; while (cursor < buf_end) { int64_t read_bytes = 0; @@ -600,6 +601,7 @@ http2_decode_header_blocks(HTTPHdr *hdr, const uint8_t *buf_start, const uint8_t return HPACK_ERROR_COMPRESSION_ERROR; } cursor += read_bytes; + header_field_started = true; break; case HPACK_FIELD_INDEXED_LITERAL: case HPACK_FIELD_NOINDEX_LITERAL: @@ -609,8 +611,12 @@ http2_decode_header_blocks(HTTPHdr *hdr, const uint8_t *buf_start, const uint8_t return HPACK_ERROR_COMPRESSION_ERROR; } cursor += read_bytes; + header_field_started = true; break; case HPACK_FIELD_TABLESIZE_UPDATE: + if (header_field_started) { + return HPACK_ERROR_COMPRESSION_ERROR; + } read_bytes = update_dynamic_table_size(cursor, buf_end, dynamic_table); if (read_bytes == HPACK_ERROR_COMPRESSION_ERROR) { return HPACK_ERROR_COMPRESSION_ERROR;
