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 2013/02/08 19:26:32 UTC

[1/2] git commit: TS-1701 segv if header_rewrite is configured with the InkAPI and uses PATH or QUERY conditions

TS-1701 segv if header_rewrite is configured with the InkAPI and uses PATH or QUERY conditions


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/80445f1c
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/80445f1c
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/80445f1c

Branch: refs/heads/master
Commit: 80445f1c1ad4d82eacd5620c370d35c232914de3
Parents: d96818b
Author: John Kew <John Kew>
Authored: Fri Feb 8 11:20:40 2013 -0700
Committer: Leif Hedstrom <zw...@apache.org>
Committed: Fri Feb 8 11:20:40 2013 -0700

----------------------------------------------------------------------
 plugins/experimental/header_rewrite/conditions.cc |    8 ++++++++
 1 files changed, 8 insertions(+), 0 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/80445f1c/plugins/experimental/header_rewrite/conditions.cc
----------------------------------------------------------------------
diff --git a/plugins/experimental/header_rewrite/conditions.cc b/plugins/experimental/header_rewrite/conditions.cc
index 08994de..553000e 100644
--- a/plugins/experimental/header_rewrite/conditions.cc
+++ b/plugins/experimental/header_rewrite/conditions.cc
@@ -238,6 +238,10 @@ ConditionPath::eval(const Resources& res)
 {
   std::string s;
 
+  if (NULL == res._rri) {
+    TSDebug(PLUGIN_NAME, "PATH requires remap initialization! Evaluating to false!");
+    return false;
+  }
   append_value(s, res);
   TSDebug(PLUGIN_NAME, "Evaluating PATH");
 
@@ -270,6 +274,10 @@ ConditionQuery::eval(const Resources& res)
 {
   std::string s;
 
+  if (NULL == res._rri) {
+    TSDebug(PLUGIN_NAME, "QUERY requires remap initialization! Evaluating to false!");
+    return false;
+  }
   append_value(s, res);
   TSDebug(PLUGIN_NAME, "Evaluating QUERY - %s", s.c_str());
   return static_cast<const Matchers<std::string>*>(_matcher)->test(s);