You are viewing a plain text version of this content. The canonical link for it is here.
Posted to github@trafficserver.apache.org by GitBox <gi...@apache.org> on 2020/07/01 15:15:44 UTC

[GitHub] [trafficserver] a-canary commented on a change in pull request #6950: Prevent buffer overflow during log filter actions

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) {`




----------------------------------------------------------------
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:
users@infra.apache.org