Skip to content

Commit

Permalink
topic_transport: receiver/depacketizer: prune before accessing the list
Browse files Browse the repository at this point in the history
This could potentially trigger a segfault when all messages are older
than 5s.

Maybe related: AIS-Bonn#17
  • Loading branch information
xqms authored and Marco Tranzatto committed Aug 13, 2021
1 parent 2c0ecef commit 366a827
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions nimbro_topic_transport/src/receiver/depacketizer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@ void Depacketizer::addPacket(const Packet::Ptr& packet)

if(it == m_messageBuffer.end())
{
pruneMessages();

m_messageBuffer.push_front(PartialMessage(msg_id));
it = m_messageBuffer.begin();

pruneMessages();
}

handleMessagePacket(it, packet);
Expand Down

0 comments on commit 366a827

Please sign in to comment.