This is an automated email from the ASF dual-hosted git repository.
amc pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/master by this push:
new 04bfb45 Fix potential unterminated string in logging in state machine.
04bfb45 is described below
commit 04bfb458c8390130f5d5cb93b8117ae4b9de15ea
Author: Alan M. Carroll <[email protected]>
AuthorDate: Wed Jan 16 13:09:32 2019 -0600
Fix potential unterminated string in logging in state machine.
---
proxy/http/HttpSM.cc | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/proxy/http/HttpSM.cc b/proxy/http/HttpSM.cc
index e9ea12a..f59a2c2 100644
--- a/proxy/http/HttpSM.cc
+++ b/proxy/http/HttpSM.cc
@@ -49,6 +49,7 @@
#include <openssl/ssl.h>
#include <algorithm>
#include <atomic>
+#include <logging/Log.h>
#define DEFAULT_RESPONSE_BUFFER_SIZE_INDEX 6 // 8K
#define DEFAULT_REQUEST_BUFFER_SIZE_INDEX 6 // 8K
@@ -5217,9 +5218,12 @@ HttpSM::mark_host_failure(HostDBInfo *info, time_t
time_down)
if (info->app.http_data.last_failure == 0) {
char *url_str =
t_state.hdr_info.client_request.url_string_get(&t_state.arena, nullptr);
Log::error("%s", lbw()
- .print("CONNECT: could not connect to {} for '{}'
(setting last failure time) connect_result={}\0",
- t_state.current.server->dst_addr, url_str ?
url_str : "<none>",
-
ts::bwf::Errno(t_state.current.server->connect_result))
+ .clip(1)
+ .print("CONNECT Error: {} connecting to {} for '{}'
(setting last failure time)",
+
ts::bwf::Errno(t_state.current.server->connect_result),
t_state.current.server->dst_addr,
+ ts::bwf::FirstOf(url_str, "<none>"))
+ .extend(1)
+ .write('\0')
.data());
if (url_str) {