mirror of
https://github.com/Cisco-Talos/clamav.git
synced 2026-05-19 05:46:50 -04:00
fix handling of bfs_last (bb#713)
git-svn: trunk@3381
This commit is contained in:
@@ -1,3 +1,7 @@
|
||||
Thu Dec 6 15:39:11 CET 2007 (tk)
|
||||
---------------------------------
|
||||
* libclamav/matcher-ac.c: fix handling of bfs_last (bb#713)
|
||||
|
||||
Thu Dec 6 15:29:00 CET 2007 (tk)
|
||||
---------------------------------
|
||||
* libclamav/others.c: bump f-level
|
||||
|
||||
@@ -204,7 +204,7 @@ static int bfs_enqueue(struct bfs_list **bfs, struct bfs_list **last, struct cli
|
||||
return CL_SUCCESS;
|
||||
}
|
||||
|
||||
static struct cli_ac_node *bfs_dequeue(struct bfs_list **bfs)
|
||||
static struct cli_ac_node *bfs_dequeue(struct bfs_list **bfs, struct bfs_list **last)
|
||||
{
|
||||
struct bfs_list *lpt;
|
||||
struct cli_ac_node *pt;
|
||||
@@ -215,6 +215,8 @@ static struct cli_ac_node *bfs_dequeue(struct bfs_list **bfs)
|
||||
} else {
|
||||
*bfs = (*bfs)->next;
|
||||
pt = lpt->node;
|
||||
if(lpt == *last)
|
||||
*last = NULL;
|
||||
free(lpt);
|
||||
return pt;
|
||||
}
|
||||
@@ -239,7 +241,7 @@ static int ac_maketrans(struct cli_matcher *root)
|
||||
}
|
||||
}
|
||||
|
||||
while((node = bfs_dequeue(&bfs))) {
|
||||
while((node = bfs_dequeue(&bfs, &bfs_last))) {
|
||||
if(node->leaf)
|
||||
continue;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user