diff --git a/src/decode-ipv4.c b/src/decode-ipv4.c index 6477e2f05a..5e1c0e20d6 100644 --- a/src/decode-ipv4.c +++ b/src/decode-ipv4.c @@ -1557,6 +1557,7 @@ int DecodeIPV4DefragTest01(void) memset(&tv, 0, sizeof(ThreadVars)); memset(&dtv, 0, sizeof(DecodeThreadVars)); memset(&pq, 0, sizeof(PacketQueue)); + memset(p, 0, SIZE_OF_PACKET); PACKET_INITIALIZE(p); FlowInitConfig(FLOW_QUIET); @@ -1695,6 +1696,7 @@ int DecodeIPV4DefragTest02(void) memset(&tv, 0, sizeof(ThreadVars)); memset(&dtv, 0, sizeof(DecodeThreadVars)); memset(&pq, 0, sizeof(PacketQueue)); + memset(p, 0, SIZE_OF_PACKET); PACKET_INITIALIZE(p); FlowInitConfig(FLOW_QUIET); @@ -1824,6 +1826,7 @@ int DecodeIPV4DefragTest03(void) memset(&tv, 0, sizeof(ThreadVars)); memset(&dtv, 0, sizeof(DecodeThreadVars)); memset(&pq, 0, sizeof(PacketQueue)); + memset(p, 0, SIZE_OF_PACKET); PACKET_INITIALIZE(p); FlowInitConfig(FLOW_QUIET); diff --git a/src/decode.c b/src/decode.c index 99c664e1e0..4f1c57b4f6 100644 --- a/src/decode.c +++ b/src/decode.c @@ -89,6 +89,7 @@ Packet *PacketGetFromAlloc(void) return NULL; } + memset(p, 0, SIZE_OF_PACKET); PACKET_INITIALIZE(p); p->flags |= PKT_ALLOC; diff --git a/src/decode.h b/src/decode.h index c918e9b472..446bdf6f7d 100644 --- a/src/decode.h +++ b/src/decode.h @@ -612,7 +612,6 @@ typedef struct DecodeThreadVars_ */ #ifndef __SC_CUDA_SUPPORT__ #define PACKET_INITIALIZE(p) { \ - memset((p), 0x00, SIZE_OF_PACKET); \ SCMutexInit(&(p)->tunnel_mutex, NULL); \ PACKET_RESET_CHECKSUMS((p)); \ (p)->pkt = ((uint8_t *)(p)) + sizeof(Packet); \ @@ -620,7 +619,6 @@ typedef struct DecodeThreadVars_ } #else #define PACKET_INITIALIZE(p) { \ - memset((p), 0x00, SIZE_OF_PACKET); \ SCMutexInit(&(p)->tunnel_mutex, NULL); \ PACKET_RESET_CHECKSUMS((p)); \ SCMutexInit(&(p)->cuda_mutex, NULL); \ diff --git a/src/stream-tcp.c b/src/stream-tcp.c index d6033c0600..c6334b45cd 100644 --- a/src/stream-tcp.c +++ b/src/stream-tcp.c @@ -9291,6 +9291,7 @@ static int StreamTcpTest40(void) { DecodeThreadVars dtv; memset(&tv, 0, sizeof(ThreadVars)); + memset(p, 0, SIZE_OF_PACKET); PACKET_INITIALIZE(p); SET_PKT_LEN(p, sizeof(raw_vlan)); @@ -9350,6 +9351,7 @@ static int StreamTcpTest41(void) { memset(&dtv, 0, sizeof(DecodeThreadVars)); memset(&tv, 0, sizeof(ThreadVars)); + memset(p, 0, SIZE_OF_PACKET); PACKET_INITIALIZE(p); if (PacketCopyData(p, raw_ip, sizeof(raw_ip)) == -1) { diff --git a/src/tmqh-packetpool.c b/src/tmqh-packetpool.c index 7bd7a59153..0418d03e60 100644 --- a/src/tmqh-packetpool.c +++ b/src/tmqh-packetpool.c @@ -122,6 +122,7 @@ void PacketPoolInit(intmax_t max_pending_packets) { SCLogError(SC_ERR_FATAL, "Fatal error encountered while allocating a packet. Exiting..."); exit(EXIT_FAILURE); } + memset(p, 0, SIZE_OF_PACKET); PACKET_INITIALIZE(p); PacketPoolStorePacket(p);