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


The following commit(s) were added to refs/heads/master by this push:
     new 811be89  Add nullptr checks in Http2Stream::update_write_request()
811be89 is described below

commit 811be8928d573211cff9047b5a7af4f0e3fc7c8f
Author: Masaori Koshiba <masa...@apache.org>
AuthorDate: Fri Apr 6 10:36:23 2018 +0900

    Add nullptr checks in Http2Stream::update_write_request()
---
 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 1965324..372ea06 100644
--- a/proxy/http2/Http2Stream.cc
+++ b/proxy/http2/Http2Stream.cc
@@ -528,7 +528,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()) {
@@ -556,6 +557,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
zw...@apache.org.

Reply via email to