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 2017/12/19 17:41:07 UTC

[trafficserver] 01/02: Delete space after semi colon when deleting cookies with test to ensure not overflowing end of cookies char buffer.

This is an automated email from the ASF dual-hosted git repository.

zwoop pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/trafficserver.git

commit d04ec06d5495d0a453290ea3f6f746534fe0dcf7
Author: Steven Feltner <sf...@godaddy.com>
AuthorDate: Tue Dec 12 13:44:45 2017 -0700

    Delete space after semi colon when deleting cookies with test to ensure not overflowing end of cookies char buffer.
---
 plugins/header_rewrite/operators.cc | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/plugins/header_rewrite/operators.cc b/plugins/header_rewrite/operators.cc
index 417a0fb..0c95b9d 100644
--- a/plugins/header_rewrite/operators.cc
+++ b/plugins/header_rewrite/operators.cc
@@ -842,6 +842,11 @@ CookieHelper::cookieModifyHelper(const char *cookies, const size_t cookies_len,
         for (; idx < cookies_len && cookies[idx] != ';'; idx++) {
           ;
         }
+        // If we have not reached the end and there is a space after the
+        // semi-colon, advance one char
+        if (idx < cookies_len && std::isspace(cookies[idx + 1])) {
+          idx++;
+        }
         // cookie value is found
         size_t value_end_idx = idx;
         if (CookieHelper::COOKIE_OP_SET == cookie_op) {

-- 
To stop receiving notification emails like this one, please contact
"commits@trafficserver.apache.org" <co...@trafficserver.apache.org>.