Skip to content

Commit

Permalink
napatech: fix null-dereference of packet
Browse files Browse the repository at this point in the history
  • Loading branch information
ralpheastwood authored and victorjulien committed Sep 5, 2023
1 parent a475613 commit 185f605
Showing 1 changed file with 5 additions and 6 deletions.
11 changes: 5 additions & 6 deletions src/source-napatech.c
Original file line number Diff line number Diff line change
Expand Up @@ -927,17 +927,16 @@ TmEcode NapatechPacketLoop(ThreadVars *tv, void *data, void *slot)
}

Packet *p = PacketGetFromQueueOrAlloc();
#ifdef NAPATECH_ENABLE_BYPASS
p->ntpv.bypass = 0;
#endif

p->ntpv.rx_stream = ntv->rx_stream;

if (unlikely(p == NULL)) {
NT_NetRxRelease(ntv->rx_stream, packet_buffer);
SCReturnInt(TM_ECODE_FAILED);
}

#ifdef NAPATECH_ENABLE_BYPASS
p->ntpv.bypass = 0;
#endif
p->ntpv.rx_stream = ntv->rx_stream;

pkt_ts = NT_NET_GET_PKT_TIMESTAMP(packet_buffer);

/*
Expand Down

0 comments on commit 185f605

Please sign in to comment.