From 03fea775cbb957e11d04091271f0fe1a7c08fb65 Mon Sep 17 00:00:00 2001 From: Natale Patriciello Date: Tue, 14 Feb 2017 11:44:38 -0800 Subject: [PATCH] tcp: Avoid accessing an empty packet sent list --- src/internet/model/tcp-tx-buffer.cc | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/internet/model/tcp-tx-buffer.cc b/src/internet/model/tcp-tx-buffer.cc index 6ad74cc25..055dec90b 100644 --- a/src/internet/model/tcp-tx-buffer.cc +++ b/src/internet/model/tcp-tx-buffer.cc @@ -1022,13 +1022,13 @@ TcpTxBuffer::IsHeadRetransmitted () const { NS_LOG_FUNCTION (this); - TcpTxItem *item = m_sentList.front (); - if (item != 0) + if (m_sentSize == 0) { - return item->m_retrans; + return false; } - return false; + NS_ASSERT (m_sentList.size () > 0); + return m_sentList.front ()->m_retrans; } Ptr