From bfe3a4180cf77e828c8d700d44bba960e408c741 Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Sat, 1 Dec 2018 10:06:54 +0100 Subject: [PATCH] detect/mpm: fix fast_pattern handling of len >255 The fast pattern selection logic would truncate a patterns len to 255 leading to assigning the same pid to different patterns. This in turn would be caught by the hyperscan setup code which would abort. Bug #2714. --- src/detect-engine-mpm.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/detect-engine-mpm.c b/src/detect-engine-mpm.c index 6351455319..ff39dfe08f 100644 --- a/src/detect-engine-mpm.c +++ b/src/detect-engine-mpm.c @@ -1350,7 +1350,7 @@ int DetectSetFastPatternAndItsId(DetectEngineCtx *de_ctx) return -1; uint8_t *content = NULL; - uint8_t content_len = 0; + uint16_t content_len = 0; PatIntId max_id = 0; DetectFPAndItsId *struct_offset = (DetectFPAndItsId *)ahb; uint8_t *content_offset = ahb + struct_total_size;