mirror of
https://github.com/Cisco-Talos/clamav.git
synced 2025-10-19 18:33:16 +00:00
bb#9659 correction to construction of Aho-Corasick trie fail links.
This commit is contained in:
parent
9354e51399
commit
51c9a991eb
1 changed files with 3 additions and 2 deletions
|
@ -315,9 +315,10 @@ static int ac_maketrans(struct cli_matcher *root)
|
||||||
while((node = bfs_dequeue(&bfs, &bfs_last))) {
|
while((node = bfs_dequeue(&bfs, &bfs_last))) {
|
||||||
if(IS_LEAF(node)) {
|
if(IS_LEAF(node)) {
|
||||||
struct cli_ac_node *failtarget = node->fail;
|
struct cli_ac_node *failtarget = node->fail;
|
||||||
while(IS_LEAF(failtarget))
|
while (NULL != failtarget && (IS_LEAF(failtarget) || !IS_FINAL(failtarget)))
|
||||||
failtarget = failtarget->fail;
|
failtarget = failtarget->fail;
|
||||||
node->fail = failtarget;
|
if (NULL != failtarget)
|
||||||
|
node->fail = failtarget;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue