tcp: Avoid accessing an empty packet sent list

This commit is contained in:
Natale Patriciello
2017-02-14 11:44:38 -08:00
parent 4b67fc4fb4
commit 03fea775cb

View File

@@ -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<const TcpOptionSack>