You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by zw...@apache.org on 2017/12/15 21:24:16 UTC
[trafficserver] branch 7.1.x updated: logging: fix incorrect use of
LogAccess::strlen()
This is an automated email from the ASF dual-hosted git repository.
zwoop pushed a commit to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/7.1.x by this push:
new b5928fe logging: fix incorrect use of LogAccess::strlen()
b5928fe is described below
commit b5928fef742cd5ad9e019c943006f276ef90b5ee
Author: Liss Tarnell <ft...@le-Fay.ORG>
AuthorDate: Fri Dec 15 09:47:16 2017 +0000
logging: fix incorrect use of LogAccess::strlen()
several unmarshal functions in proxy/logging/LogAccess.cc incorrectly
use LogAccess::strlen() instead of std::strlen() to determine the length
of the result. LogAccess::strlen() rounds its return value to multiples
of 8, meaning an incorrect length would be returned (longer than the
actual string) and data past the end of the string would be written to
the logfile.
this manifested as NUL characters in logfiles using %<cqtn>, %<cqtt> and
%<cqtd>:
::1 phptest.local [15/Dec/2017:15:03:28 -0000^@^@^@^@^@^@] "GET / HTTP/1.1" 503
this closes #2940 (%<cqtn> is full of NULs)
(cherry picked from commit fd2535c05e977913875ac1f5b6d1f8148764d826)
---
proxy/logging/LogAccess.cc | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
diff --git a/proxy/logging/LogAccess.cc b/proxy/logging/LogAccess.cc
index 5ede23e..2af4915 100644
--- a/proxy/logging/LogAccess.cc
+++ b/proxy/logging/LogAccess.cc
@@ -1032,7 +1032,7 @@ LogAccess::unmarshal_int_to_date_str(char **buf, char *dest, int len)
int64_t value = unmarshal_int(buf);
char *strval = LogUtils::timestamp_to_date_str(value);
- int strlen = LogAccess::strlen(strval);
+ int strlen = (int)::strlen(strval);
memcpy(dest, strval, strlen);
return strlen;
@@ -1047,7 +1047,7 @@ LogAccess::unmarshal_int_to_time_str(char **buf, char *dest, int len)
int64_t value = unmarshal_int(buf);
char *strval = LogUtils::timestamp_to_time_str(value);
- int strlen = LogAccess::strlen(strval);
+ int strlen = (int)::strlen(strval);
memcpy(dest, strval, strlen);
return strlen;
@@ -1062,7 +1062,7 @@ LogAccess::unmarshal_int_to_netscape_str(char **buf, char *dest, int len)
int64_t value = unmarshal_int(buf);
char *strval = LogUtils::timestamp_to_netscape_str(value);
- int strlen = LogAccess::strlen(strval);
+ int strlen = (int)::strlen(strval);
memcpy(dest, strval, strlen);
return strlen;
--
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].