You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by so...@apache.org on 2016/05/31 15:54:46 UTC

[trafficserver] 01/09: Prevent segfault dealocating a NULL buffer_reader.

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

sorber pushed a commit to branch 6.2.x
in repository https://git-dual.apache.org/repos/asf/trafficserver.git

commit 07f3de804b79ba794430ec754175a07f27d40cd6
Author: David Calavera <da...@gmail.com>
AuthorDate: Fri May 13 13:47:14 2016 -0700

    Prevent segfault dealocating a NULL buffer_reader.
    
    Signed-off-by: David Calavera <da...@gmail.com>
    (cherry picked from commit 0f3548015c062def879a1dcb0cb57b38daeea2de)
---
 proxy/http/HttpTunnel.cc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/proxy/http/HttpTunnel.cc b/proxy/http/HttpTunnel.cc
index adc84ae..b96cc4b 100644
--- a/proxy/http/HttpTunnel.cc
+++ b/proxy/http/HttpTunnel.cc
@@ -1386,8 +1386,10 @@ HttpTunnel::consumer_handler(int event, HttpTunnelConsumer *c)
     // Deallocate the reader after calling back the sm
     //  because buffer problems are easier to debug
     //  in the sm when the reader is still valid
-    c->buffer_reader->mbuf->dealloc_reader(c->buffer_reader);
-    c->buffer_reader = NULL;
+    if (c->buffer_reader) {
+      c->buffer_reader->mbuf->dealloc_reader(c->buffer_reader);
+      c->buffer_reader = NULL;
+    }
 
     // Since we removed a consumer, it may now be
     //   possbile to put more stuff in the buffer

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