]> git.ipfire.org Git - thirdparty/suricata.git/commitdiff
detect/mpm: fix fast_pattern handling of len >255
authorVictor Julien <victor@inliniac.net>
Sat, 1 Dec 2018 09:06:54 +0000 (10:06 +0100)
committerVictor Julien <victor@inliniac.net>
Sat, 1 Dec 2018 09:09:58 +0000 (10:09 +0100)
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

index 6351455319fe1aa59ba959ef9b9c65a88b01405e..ff39dfe08f72a791faeee1827f131052e6986661 100644 (file)
@@ -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;