This is an automated email from the ASF dual-hosted git repository.
bcall pushed a commit to branch 9.2.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/9.2.x by this push:
new 4ca137b59b Reallocate a buffer for H2 header block only if needed
(#10568)
4ca137b59b is described below
commit 4ca137b59bc6aaa25f8b14db2bdd2e72c43502e5
Author: Masakazu Kitajo <[email protected]>
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 <[email protected]>
(cherry picked from commit 65dd18632648e5441df115c4ed666af02e61d2d9)
---
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 888fdc39b5..dcfab9b674 100644
--- a/proxy/http2/Http2ConnectionState.cc
+++ b/proxy/http2/Http2ConnectionState.cc
@@ -937,8 +937,10 @@ rcv_continuation_frame(Http2ConnectionState &cstate, 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.