This is an automated email from the ASF dual-hosted git repository. bcall pushed a commit to branch master in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push: new 65dd186326 Reallocate a buffer for H2 header block only if needed (#10568) 65dd186326 is described below commit 65dd18632648e5441df115c4ed666af02e61d2d9 Author: Masakazu Kitajo <mas...@apache.org> AuthorDate: Tue Oct 10 00:33:06 2023 +0900 Reallocate a buffer for H2 header block only if needed (#10568) Co-authored-by: Bryan Call <bc...@apache.org> --- proxy/http2/Http2ConnectionState.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/proxy/http2/Http2ConnectionState.cc b/proxy/http2/Http2ConnectionState.cc index 05ac31dcb2..7c9db663a8 100644 --- a/proxy/http2/Http2ConnectionState.cc +++ b/proxy/http2/Http2ConnectionState.cc @@ -1007,8 +1007,10 @@ Http2ConnectionState::rcv_continuation_frame(const Http2Frame &frame) "header blocks too large"); } - stream->header_blocks = static_cast<uint8_t *>(ats_realloc(stream->header_blocks, stream->header_blocks_length)); - frame.reader()->memcpy(stream->header_blocks + header_blocks_offset, payload_length); + if (payload_length > 0) { + stream->header_blocks = static_cast<uint8_t *>(ats_realloc(stream->header_blocks, stream->header_blocks_length)); + frame.reader()->memcpy(stream->header_blocks + header_blocks_offset, payload_length); + } if (frame.header().flags & HTTP2_FLAGS_HEADERS_END_HEADERS) { // NOTE: If there are END_HEADERS flag, decode stored Header Blocks.