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 2018/04/06 23:42:46 UTC

[trafficserver] branch 7.1.x updated (1a7d6e9 -> 44fbd49)

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

zwoop pushed a change to branch 7.1.x
in repository https://gitbox.apache.org/repos/asf/trafficserver.git.


    from 1a7d6e9  HostDB - removing infinite ttl (0)
     new 560a28b  Add nullptr checks in Http2Stream::update_write_request()
     new 44fbd49  Fixed length calculation for url_sig excl regexes.

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 plugins/experimental/url_sig/url_sig.c | 18 ++++++++----------
 proxy/http2/Http2Stream.cc             |  6 +++++-
 2 files changed, 13 insertions(+), 11 deletions(-)

-- 
To stop receiving notification emails like this one, please contact
zwoop@apache.org.

[trafficserver] 02/02: Fixed length calculation for url_sig excl regexes.

Posted by zw...@apache.org.
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

commit 44fbd49b1e2f31dfed4a51df62e1237ae63e73aa
Author: Chris Lemmons <al...@gmail.com>
AuthorDate: Fri Apr 6 11:55:55 2018 -0600

    Fixed length calculation for url_sig excl regexes.
    
    The old calculation was incorrectly calculating the length to be
    searched. Fortunately, it was not possible for the length to be
    overlong, so there is no security concern, simply a bug that caused some
    requests that should have been whitelisted via the excl regex to be
    validated (and therefore to fail) incorrectly.
    
    This change corrects the calculation.
    
    (cherry picked from commit 96466de3093d1c8734ea2d82861101c1adb97fef)
---
 plugins/experimental/url_sig/url_sig.c | 18 ++++++++----------
 1 file changed, 8 insertions(+), 10 deletions(-)

diff --git a/plugins/experimental/url_sig/url_sig.c b/plugins/experimental/url_sig/url_sig.c
index cd4ebeb..f27dd88 100644
--- a/plugins/experimental/url_sig/url_sig.c
+++ b/plugins/experimental/url_sig/url_sig.c
@@ -510,17 +510,15 @@ TSRemapDoRemap(void *ih, TSHttpTxn txnp, TSRemapRequestInfo *rri)
   const char *query = strchr(url, '?');
 
   if (cfg->regex) {
-    int offset = 0, options = 0;
+    const int offset = 0, options = 0;
     int ovector[30];
-    int len            = url_len;
-    const char *anchor = strchr(url, '#');
-    if (query && !anchor) {
-      len -= (query - url);
-    } else if (anchor && !query) {
-      len -= (anchor - url);
-    } else if (anchor && query) {
-      len -= ((query < anchor ? query : anchor) - url);
-    }
+
+    /* Only search up to the first ? or # */
+    const char *base_url_end = url;
+    while (*base_url_end && !(*base_url_end == '?' || *base_url_end == '#'))
+      ++base_url_end;
+    const int len = base_url_end - url;
+
     if (pcre_exec(cfg->regex, cfg->regex_extra, url, len, offset, options, ovector, 30) >= 0) {
       goto allow;
     }

-- 
To stop receiving notification emails like this one, please contact
zwoop@apache.org.

[trafficserver] 01/02: Add nullptr checks in Http2Stream::update_write_request()

Posted by zw...@apache.org.
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

commit 560a28bb564b64908335b4b02342ac5cb29db9b8
Author: Masaori Koshiba <ma...@apache.org>
AuthorDate: Fri Apr 6 10:36:23 2018 +0900

    Add nullptr checks in Http2Stream::update_write_request()
    
    (cherry picked from commit 811be8928d573211cff9047b5a7af4f0e3fc7c8f)
---
 proxy/http2/Http2Stream.cc | 6 +++++-
 1 file changed, 5 insertions(+), 1 deletion(-)

diff --git a/proxy/http2/Http2Stream.cc b/proxy/http2/Http2Stream.cc
index 006136a..a328df8 100644
--- a/proxy/http2/Http2Stream.cc
+++ b/proxy/http2/Http2Stream.cc
@@ -525,7 +525,8 @@ Http2Stream::restart_sending()
 void
 Http2Stream::update_write_request(IOBufferReader *buf_reader, int64_t write_len, bool call_update)
 {
-  if (!this->is_client_state_writeable() || closed || parent == nullptr || write_vio.mutex == nullptr) {
+  if (!this->is_client_state_writeable() || closed || parent == nullptr || write_vio.mutex == nullptr ||
+      (buf_reader == nullptr && write_len == 0)) {
     return;
   }
   if (this->get_thread() != this_ethread()) {
@@ -553,6 +554,9 @@ Http2Stream::update_write_request(IOBufferReader *buf_reader, int64_t write_len,
     }
   }
 
+  if (this->response_get_data_reader() == nullptr) {
+    return;
+  }
   int64_t bytes_avail = this->response_get_data_reader()->read_avail();
   if (write_vio.nbytes > 0 && write_vio.ntodo() > 0) {
     int64_t num_to_write = write_vio.ntodo();

-- 
To stop receiving notification emails like this one, please contact
zwoop@apache.org.