diff --git a/src/flow-hash.c b/src/flow-hash.c index 5984ad9573..fb4892d802 100644 --- a/src/flow-hash.c +++ b/src/flow-hash.c @@ -658,7 +658,7 @@ static void FlowExceptionPolicyStatsIncr( ThreadVars *tv, FlowLookupStruct *fls, enum ExceptionPolicy policy) { #ifdef UNITTESTS - if (tv == NULL) { + if (tv == NULL || fls->dtv == NULL) { return; } #endif diff --git a/src/util-unittest-helper.c b/src/util-unittest-helper.c index c1fa775255..4d56b2d377 100644 --- a/src/util-unittest-helper.c +++ b/src/util-unittest-helper.c @@ -860,6 +860,8 @@ uint32_t UTHBuildPacketOfFlows(uint32_t start, uint32_t end, uint8_t dir) { FlowLookupStruct fls; memset(&fls, 0, sizeof(fls)); + ThreadVars tv; + memset(&tv, 0, sizeof(tv)); uint32_t i = start; uint8_t payload[] = "Payload"; @@ -872,7 +874,7 @@ uint32_t UTHBuildPacketOfFlows(uint32_t start, uint32_t end, uint8_t dir) p->src.addr_data32[0] = i + 1; p->dst.addr_data32[0] = i; } - FlowHandlePacket(NULL, &fls, p); + FlowHandlePacket(&tv, &fls, p); if (p->flow != NULL) { FLOWLOCK_UNLOCK(p->flow); }