]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
napatech: fix null-dereference of packet 9441/head
authorRalph Eastwood <rea@napatech.com>
Mon, 21 Aug 2023 09:05:57 +0000 (11:05 +0200)
committerVictor Julien <victor@inliniac.net>
Tue, 5 Sep 2023 12:21:34 +0000 (14:21 +0200)
src/source-napatech.c

index 44201a2bb361d004dcf650721d1e1b15183f6015..5d5e1f674d158f9485c18c254b6643d9e9084bda 100644 (file)
@@ -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);
 
         /*