You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@trafficserver.apache.org by ma...@apache.org on 2017/10/17 06:04:44 UTC

[trafficserver] branch quic-latest updated: Add null checks

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

maskit pushed a commit to branch quic-latest
in repository https://gitbox.apache.org/repos/asf/trafficserver.git


The following commit(s) were added to refs/heads/quic-latest by this push:
     new 266d5cb  Add null checks
266d5cb is described below

commit 266d5cb0ea2a57142975f8816f01481f50941e4e
Author: Masakazu Kitajo <ma...@apache.org>
AuthorDate: Tue Oct 17 15:04:18 2017 +0900

    Add null checks
---
 iocore/net/QUICNetVConnection.cc | 12 ++++++++++--
 1 file changed, 10 insertions(+), 2 deletions(-)

diff --git a/iocore/net/QUICNetVConnection.cc b/iocore/net/QUICNetVConnection.cc
index ab3cad0..90ccb7b 100644
--- a/iocore/net/QUICNetVConnection.cc
+++ b/iocore/net/QUICNetVConnection.cc
@@ -380,6 +380,9 @@ QUICNetVConnection::state_handshake(int event, Event *data)
   switch (event) {
   case QUIC_EVENT_PACKET_READ_READY: {
     QUICPacketUPtr p = this->_dequeue_recv_packet();
+    if (!p) {
+      break;
+    }
     net_activity(this, this_ethread());
 
     switch (p->type()) {
@@ -713,6 +716,9 @@ QUICNetVConnection::_state_common_receive_packet()
 {
   QUICErrorUPtr error = QUICErrorUPtr(new QUICNoError());
   QUICPacketUPtr p    = this->_dequeue_recv_packet();
+  if (!p) {
+    return error;
+  }
   net_activity(this, this_ethread());
 
   switch (p->type()) {
@@ -970,7 +976,9 @@ QUICNetVConnection::_dequeue_recv_packet()
     this->_quic_packet_recv_queue.push(std::move(quic_packet));
     quic_packet.reset(p.release());
   }
-  DebugQUICCon("type=%s pkt_num=%" PRIu64 " size=%u", QUICDebugNames::packet_type(quic_packet->type()),
-               quic_packet->packet_number(), quic_packet->size());
+  if (quic_packet) {
+    DebugQUICCon("type=%s pkt_num=%" PRIu64 " size=%u", QUICDebugNames::packet_type(quic_packet->type()),
+                 quic_packet->packet_number(), quic_packet->size());
+  }
   return quic_packet;
 }

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