output: fix NULL deref if no app-layer is logged

Ticket: 7815
pull/13683/head
Philippe Antoine 4 months ago committed by Jason Ish
parent 9a01c1be8e
commit c20dddb046

@ -627,6 +627,12 @@ static TmEcode OutputTxLogThreadDeinit(ThreadVars *tv, void *thread_data)
static uint32_t OutputTxLoggerGetActiveCount(void)
{
if (list == NULL) {
// This may happen in socket mode playing pcaps
// when suricata.yaml logs only alerts (and no app-layer events)
return 0;
}
uint32_t cnt = 0;
for (AppProto alproto = 0; alproto < g_alproto_max; alproto++) {
for (OutputTxLogger *p = list[alproto]; p != NULL; p = p->next) {

Loading…
Cancel
Save