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 5f928e8  Fix off-by-one access in header_rewrite config parser
5f928e8 is described below

commit 5f928e80978d6316a737505da320f2cff042bd18
Author: Masakazu Kitajo <[email protected]>
AuthorDate: Wed Jun 13 17:07:18 2018 +0900

    Fix off-by-one access in header_rewrite config parser
    
    (cherry picked from commit 77882a648837c399c4ffaea7249bf5b8b0a39b6c)
---
 plugins/header_rewrite/header_rewrite.cc | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/plugins/header_rewrite/header_rewrite.cc 
b/plugins/header_rewrite/header_rewrite.cc
index 1f30de2..92fa7a7 100644
--- a/plugins/header_rewrite/header_rewrite.cc
+++ b/plugins/header_rewrite/header_rewrite.cc
@@ -185,7 +185,7 @@ RulesConfig::parse_config(const std::string &fname, 
TSHttpHookID default_hook)
       line.erase(0, 1);
     }
 
-    while (std::isspace(line[line.length() - 1])) {
+    while (line.length() > 0 && std::isspace(line[line.length() - 1])) {
       line.erase(line.length() - 1, 1);
     }
 

-- 
To stop receiving notification emails like this one, please contact
[email protected].

Reply via email to