Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
added patch to fix a bug where repetitive strings could not be matche…
…d within payload data except at specific offests git-svn-id: file:///home/mbr/svn/fwsnort_repos/fwsnort/trunk@274 af5c991a-1414-0410-86ad-c3437102cd4a
- Loading branch information
Showing
1 changed file
with
32 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Original file line | Diff line number | Diff line change |
---|---|---|---|
@@ -0,0 +1,32 @@ | |||
--- linux-2.6.17.8/lib/ts_bm.c.orig 2006-08-16 21:17:38.000000000 -0400 | |||
+++ linux-2.6.17.8/lib/ts_bm.c 2006-08-17 10:35:25.000000000 -0400 | |||
@@ -112,15 +112,14 @@ | |||
return ret; | |||
} | |||
|
|||
-static void compute_prefix_tbl(struct ts_bm *bm, const u8 *pattern, | |||
- unsigned int len) | |||
+static void compute_prefix_tbl(struct ts_bm *bm) | |||
{ | |||
int i, j, g; | |||
|
|||
for (i = 0; i < ASIZE; i++) | |||
- bm->bad_shift[i] = len; | |||
- for (i = 0; i < len - 1; i++) | |||
- bm->bad_shift[pattern[i]] = len - 1 - i; | |||
+ bm->bad_shift[i] = bm->patlen; | |||
+ for (i = 0; i < bm->patlen - 1; i++) | |||
+ bm->bad_shift[bm->pattern[i]] = bm->patlen - 1 - i; | |||
|
|||
/* Compute the good shift array, used to match reocurrences | |||
* of a subpattern */ | |||
@@ -151,8 +150,8 @@ | |||
bm = ts_config_priv(conf); | |||
bm->patlen = len; | |||
bm->pattern = (u8 *) bm->good_shift + prefix_tbl_len; | |||
- compute_prefix_tbl(bm, pattern, len); | |||
memcpy(bm->pattern, pattern, len); | |||
+ compute_prefix_tbl(bm); | |||
|
|||
return conf; | |||
} |