vuori commented on code in PR #12634:
URL: https://github.com/apache/trafficserver/pull/12634#discussion_r2487666666
##########
plugins/stats_over_http/stats_over_http.cc:
##########
@@ -804,7 +804,17 @@ stats_origin(TSCont contp, TSEvent /* event ATS_UNUSED */,
void *edata)
my_state->encoding = encoding_format_t::NONE;
if (accept_encoding_field != TS_NULL_MLOC) {
int len = -1;
- const char *str = TSMimeHdrFieldValueStringGet(reqp, hdr_loc,
accept_encoding_field, -1, &len);
+ const char *mime_str = TSMimeHdrFieldValueStringGet(reqp, hdr_loc,
accept_encoding_field, -1, &len);
+ char *str = nullptr;
+
+ // Ensure str is null-terminated for strstr()
+ if (len > 0) {
+ str = TSstrndup(mime_str, len);
Review Comment:
ugghhh I'll think about it. Not very enthusiastic at all about all this code
that just duplicates `compress`, the only reason I'm touching this is to make a
thing that insists on sending `Accept-Encoding: identity` work reliably.
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]