Skip to content

Commit

Permalink
Avoid undefined behavior on LRUList (#258)
Browse files Browse the repository at this point in the history
  • Loading branch information
leoparente authored Apr 6, 2022
1 parent dbc2533 commit 2164854
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/inputs/pcap/PcapInputStream.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -384,6 +384,9 @@ void PcapInputStream::process_raw_packet(pcpp::RawPacket *rawPacket)
}

for (uint8_t counter = 0; counter < MAX_TCP_CLEANUPS; counter++) {
if (_lru_list.getSize() == 0) {
break;
}
auto connection = _lru_list.getLRUElement();
if (timestamp.tv_sec < connection.second.tv_sec + TCP_TIMEOUT) {
break;
Expand Down

0 comments on commit 2164854

Please sign in to comment.