From 789dcbd49d077b54726fb09738fb0f42112d00d0 Mon Sep 17 00:00:00 2001 From: Phil Young Date: Wed, 11 Nov 2020 14:21:39 -0500 Subject: [PATCH] napatech: Fix potential double release of packet This addresses readmine issue #4018. There was the potential for a packet buffer to be released twice in response to an error condition. This addresses this by only calling NT_NetRxRelease() when the p->ReleasePacket is called. --- src/source-napatech.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/source-napatech.c b/src/source-napatech.c index c30a4fb213..a18616e512 100644 --- a/src/source-napatech.c +++ b/src/source-napatech.c @@ -1001,12 +1001,10 @@ TmEcode NapatechPacketLoop(ThreadVars *tv, void *data, void *slot) if (unlikely(PacketSetData(p, (uint8_t *)NT_NET_GET_PKT_L2_PTR(packet_buffer), NT_NET_GET_PKT_WIRE_LENGTH(packet_buffer)))) { TmqhOutputPacketpool(ntv->tv, p); - NT_NetRxRelease(ntv->rx_stream, packet_buffer); SCReturnInt(TM_ECODE_FAILED); } if (unlikely(TmThreadsSlotProcessPkt(ntv->tv, ntv->slot, p) != TM_ECODE_OK)) { - NT_NetRxRelease(ntv->rx_stream, packet_buffer); SCReturnInt(TM_ECODE_FAILED); } -- 2.47.2