Repository: trafficserver
Updated Branches:
  refs/heads/master 0b2c2f96d -> ee446f9c4


[TS-3735]: Coverity CID 1309076 - Null pointer dereferences.


Project: http://git-wip-us.apache.org/repos/asf/trafficserver/repo
Commit: http://git-wip-us.apache.org/repos/asf/trafficserver/commit/946fc244
Tree: http://git-wip-us.apache.org/repos/asf/trafficserver/tree/946fc244
Diff: http://git-wip-us.apache.org/repos/asf/trafficserver/diff/946fc244

Branch: refs/heads/master
Commit: 946fc2447100e144505f5ea439db22d30a9eb0cf
Parents: 0b2c2f9
Author: Sudheer Vinukonda <[email protected]>
Authored: Thu Jul 2 15:23:54 2015 +0000
Committer: Sudheer Vinukonda <[email protected]>
Committed: Thu Jul 2 15:23:54 2015 +0000

----------------------------------------------------------------------
 iocore/net/SSLNetVConnection.cc | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/trafficserver/blob/946fc244/iocore/net/SSLNetVConnection.cc
----------------------------------------------------------------------
diff --git a/iocore/net/SSLNetVConnection.cc b/iocore/net/SSLNetVConnection.cc
index d7cb887..9b1570c 100644
--- a/iocore/net/SSLNetVConnection.cc
+++ b/iocore/net/SSLNetVConnection.cc
@@ -494,9 +494,9 @@ SSLNetVConnection::net_read_io(NetHandler *nh, EThread 
*lthread)
           // in the ssl buffers, so, SSL_read if there's anything already..
           Debug("ssl", "ssl handshake completed on vc %p, check to see if 
first byte, is already in the ssl buffers", this);
           this->iobuf = new_MIOBuffer(BUFFER_SIZE_INDEX_4K);
-          this->reader = this->iobuf->alloc_reader();
-          s->vio.buffer.writer_for(this->iobuf);
           if (this->iobuf) {
+            this->reader = this->iobuf->alloc_reader();
+            s->vio.buffer.writer_for(this->iobuf);
             ret = ssl_read_from_net(this, lthread, r);
             if (ret == SSL_READ_EOS) {
               this->eosRcvd = true;
@@ -505,6 +505,8 @@ SSLNetVConnection::net_read_io(NetHandler *nh, EThread 
*lthread)
             if (r > 0 || pending > 0) {
               Debug("ssl", "ssl read right after handshake, read %" PRId64 ", 
pending %d bytes, for vc %p", r, pending, this);
             }
+          } else {
+            Error("failed to allocate MIOBuffer after handshake, vc %p", this);
           }
           read.triggered = 0;
           read_disable(nh, this);

Reply via email to