bneradt commented on code in PR #12634:
URL: https://github.com/apache/trafficserver/pull/12634#discussion_r2583188282
##########
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:
Thank you for the patch, @vuori . I'm picking up the work here:
https://github.com/apache/trafficserver/pull/12722
--
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]