a-canary commented on a change in pull request #6950:
URL: https://github.com/apache/trafficserver/pull/6950#discussion_r448435159
##########
File path: proxy/logging/LogAccess.cc
##########
@@ -1162,7 +1162,7 @@ void
LogAccess::set_client_req_unmapped_url_canon(char *buf, int len)
{
if (buf && m_client_req_unmapped_url_canon_str) {
- m_client_req_unmapped_url_canon_len = len;
+ m_client_req_unmapped_url_canon_len = std::min(len,
m_client_req_unmapped_url_canon_len);
ink_strlcpy(m_client_req_unmapped_url_canon_str, buf,
m_client_req_unmapped_url_canon_len + 1);
Review comment:
or just `if (buf && m_client_req_unmapped_url_canon_len > 0) {`
Note when it sets the str to `INVALID_STR`, it does not set the length,
intentionally.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]