]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
protodetect: debug validation when multiple patterns match
authorPhilippe Antoine <contact@catenacyber.fr>
Mon, 2 Sep 2019 14:27:46 +0000 (16:27 +0200)
committerVictor Julien <victor@inliniac.net>
Sat, 23 Jan 2021 08:57:31 +0000 (09:57 +0100)
src/app-layer-detect-proto.c

index 8fe62ebcc82d5eede381fe8ea8d727459df3ceaf..f05c827f807e16bc5fe66bbfdabb46bdd5583e44 100644 (file)
@@ -41,6 +41,7 @@
 #include "util-pool.h"
 #include "util-unittest.h"
 #include "util-unittest-helper.h"
+#include "util-validate.h"
 
 #include "flow.h"
 #include "flow-util.h"
@@ -1551,6 +1552,7 @@ AppProto AppLayerProtoDetectGetProto(AppLayerProtoDetectThreadCtx *tctx,
         uint16_t pm_matches = AppLayerProtoDetectPMGetProto(tctx, f,
                 buf, buflen, direction, pm_results, reverse_flow);
         if (pm_matches > 0) {
+            DEBUG_VALIDATE_BUG_ON(pm_matches > 1);
             alproto = pm_results[0];
 
             // rerun probing parser for other direction if it is unknown