You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by so...@apache.org on 2017/09/22 14:58:21 UTC
[trafficserver] branch 6.2.x updated: Fix possibility of NULL
assignment to std::string
This is an automated email from the ASF dual-hosted git repository.
sorber pushed a commit to branch 6.2.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git
The following commit(s) were added to refs/heads/6.2.x by this push:
new 6e62d0f Fix possibility of NULL assignment to std::string
6e62d0f is described below
commit 6e62d0f2ae76a8e7891a4009f9139a9652193f52
Author: Phil Sorber <so...@apache.org>
AuthorDate: Sun Oct 2 18:18:35 2016 -0600
Fix possibility of NULL assignment to std::string
(cherry picked from commit 91bfe214cc2356ae19b78776815d0344d1a0906d)
---
plugins/header_rewrite/expander.cc | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)
diff --git a/plugins/header_rewrite/expander.cc b/plugins/header_rewrite/expander.cc
index 8c5238d..53dc2df 100644
--- a/plugins/header_rewrite/expander.cc
+++ b/plugins/header_rewrite/expander.cc
@@ -65,7 +65,12 @@ VariableExpander::expand(const Resources &res)
// Protocol of the incoming request
if (TSHttpTxnPristineUrlGet(res.txnp, &bufp, &url_loc) == TS_SUCCESS) {
int len;
- resolved_variable = TSUrlSchemeGet(bufp, url_loc, &len);
+ const char *tmp = TSUrlSchemeGet(bufp, url_loc, &len);
+ if ((tmp != NULL) && (len > 0)) {
+ resolved_variable.assign(tmp, len);
+ } else {
+ resolved_variable.assign("");
+ }
TSHandleMLocRelease(bufp, TS_NULL_MLOC, url_loc);
}
} else if (variable == "%<port>") {
--
To stop receiving notification emails like this one, please contact
['"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>'].