From: Philippe Antoine Date: Mon, 2 Sep 2019 14:27:46 +0000 (+0200) Subject: protodetect: debug validation when multiple patterns match X-Git-Tag: suricata-7.0.0-beta1~1844 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f5d8e953a876bdbdd882fdf0260fc23023361180;p=thirdparty%2Fsuricata.git protodetect: debug validation when multiple patterns match --- diff --git a/src/app-layer-detect-proto.c b/src/app-layer-detect-proto.c index 8fe62ebcc8..f05c827f80 100644 --- a/src/app-layer-detect-proto.c +++ b/src/app-layer-detect-proto.c @@ -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