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: #17
  • Loading branch information
xqms committed Aug 13, 2021
1 parent ed6683b commit db0d63c
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 db0d63c

Please sign in to comment.