Skip to content

Commit 2164854

Browse files
author
leoparente
authored
Avoid undefined behavior on LRUList (#258)
1 parent dbc2533 commit 2164854

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/inputs/pcap/PcapInputStream.cpp

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -384,6 +384,9 @@ void PcapInputStream::process_raw_packet(pcpp::RawPacket *rawPacket)
384384
}
385385

386386
for (uint8_t counter = 0; counter < MAX_TCP_CLEANUPS; counter++) {
387+
if (_lru_list.getSize() == 0) {
388+
break;
389+
}
387390
auto connection = _lru_list.getLRUElement();
388391
if (timestamp.tv_sec < connection.second.tv_sec + TCP_TIMEOUT) {
389392
break;

0 commit comments

Comments
 (0)