From: Victor Julien Date: Mon, 12 Sep 2016 16:15:01 +0000 (+0200) Subject: decoder-event: BUG_ON on table mismatches X-Git-Tag: suricata-3.2beta1~345 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=00313b21408c3c0ac6d128412a88a0616788b081;p=thirdparty%2Fsuricata.git decoder-event: BUG_ON on table mismatches Abort when the event enum and the name<>event table are not matching. --- diff --git a/src/decode.c b/src/decode.c index 345cb6cdae..95504d843d 100644 --- a/src/decode.c +++ b/src/decode.c @@ -427,13 +427,14 @@ void DecodeRegisterPerfCounters(DecodeThreadVars *dtv, ThreadVars *tv) StatsRegisterCounter("defrag.ipv6.timeouts", tv); dtv->counter_defrag_max_hit = StatsRegisterCounter("defrag.max_frag_hits", tv); - + int i = 0; for (i = 0; i < DECODE_EVENT_PACKET_MAX; i++) { + BUG_ON(i != (int)DEvents[i].code); dtv->counter_invalid_events[i] = StatsRegisterCounter( DEvents[i].event_name, tv); } - + return; }