From 50b2e381e08b164f026fb61a0ad1586e376e497a Mon Sep 17 00:00:00 2001 From: Victor Julien Date: Tue, 10 Nov 2009 12:59:00 +0100 Subject: [PATCH] Set the DETECT_CONTENT_WITHIN_NEXT and DETECT_CONTENT_DISTANCE_NEXT flags on content chunks if appropriate. --- src/detect-content.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/detect-content.c b/src/detect-content.c index 03603d47b0..33df3d46eb 100644 --- a/src/detect-content.c +++ b/src/detect-content.c @@ -1304,6 +1304,10 @@ int DetectContentPropagateModifiers(SigMatch *first_sm) */ cur_chunk->flags |= DETECT_CONTENT_WITHIN; cur_chunk->within = cur_chunk->content_len; + + /* set the within next flag on the previous chunk */ + if (last_chunk != NULL) + last_chunk->flags |= DETECT_CONTENT_WITHIN_NEXT; } /** We are iterating in the chunks after the first one, so distance @@ -1317,6 +1321,10 @@ int DetectContentPropagateModifiers(SigMatch *first_sm) */ cur_chunk->flags |= DETECT_CONTENT_DISTANCE; cur_chunk->distance = 0; + + /* set the distance next flag on the previous chunk */ + if (last_chunk != NULL) + last_chunk->flags |= DETECT_CONTENT_DISTANCE_NEXT; } /** The isdataat (relative) is updated to the