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 8b26437  PR-4779: Fix TLS Bridge plugin to compile regular expressions 
from file configuration correctly.
8b26437 is described below

commit 8b264377b13b99c7c7662cdafa53f28f6840a752
Author: Alan M. Carroll <[email protected]>
AuthorDate: Thu Jan 10 09:37:25 2019 -0600

    PR-4779: Fix TLS Bridge plugin to compile regular expressions from file 
configuration correctly.
---
 plugins/experimental/tls_bridge/tls_bridge.cc | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/plugins/experimental/tls_bridge/tls_bridge.cc 
b/plugins/experimental/tls_bridge/tls_bridge.cc
index 368a808..e8b78b6 100644
--- a/plugins/experimental/tls_bridge/tls_bridge.cc
+++ b/plugins/experimental/tls_bridge/tls_bridge.cc
@@ -109,7 +109,9 @@ void
 BridgeConfig::load_pair(std::string_view rxp, std::string_view service, 
ts::file::path const &src, int ln)
 {
   Regex r;
-  if (r.compile(rxp.data(), Regex::ANCHORED)) {
+  // Unfortunately PCRE can only compile null terminated strings...
+  std::string pattern{rxp};
+  if (r.compile(pattern.c_str(), Regex::ANCHORED)) {
     _items.emplace_back(rxp, std::move(r), service);
   } else {
     char buff[std::numeric_limits<int>::digits10 + 2];

Reply via email to