mirror of
https://github.com/zeek/zeek.git
synced 2025-10-02 14:48:21 +00:00
Merge branch 'topic/jazoff/expire-reuse-fix' of https://github.com/JustinAzoff/zeek
* 'topic/jazoff/expire-reuse-fix' of https://github.com/JustinAzoff/zeek: Fix variable reuse in table expiration
This commit is contained in:
commit
02783692d8
3 changed files with 8 additions and 1 deletions
4
CHANGES
4
CHANGES
|
@ -1,4 +1,8 @@
|
||||||
|
|
||||||
|
2.6-66 | 2019-01-14 10:26:47 -0600
|
||||||
|
|
||||||
|
* Fix performance issue due to variable reuse in table expiration (Justin Azoff, Corelight)
|
||||||
|
|
||||||
2.6-62 | 2019-01-10 15:45:04 -0600
|
2.6-62 | 2019-01-10 15:45:04 -0600
|
||||||
|
|
||||||
* Reorganize documentation index (Jon Siwek, Corelight)
|
* Reorganize documentation index (Jon Siwek, Corelight)
|
||||||
|
|
2
VERSION
2
VERSION
|
@ -1 +1 @@
|
||||||
2.6-62
|
2.6-66
|
||||||
|
|
|
@ -2348,6 +2348,7 @@ void TableVal::DoExpire(double t)
|
||||||
|
|
||||||
HashKey* k = 0;
|
HashKey* k = 0;
|
||||||
TableEntryVal* v = 0;
|
TableEntryVal* v = 0;
|
||||||
|
TableEntryVal* v_saved = 0;
|
||||||
|
|
||||||
for ( int i = 0; i < table_incremental_step &&
|
for ( int i = 0; i < table_incremental_step &&
|
||||||
(v = tbl->NextEntry(k, expire_cookie)); ++i )
|
(v = tbl->NextEntry(k, expire_cookie)); ++i )
|
||||||
|
@ -2371,10 +2372,12 @@ void TableVal::DoExpire(double t)
|
||||||
// It's possible that the user-provided
|
// It's possible that the user-provided
|
||||||
// function modified or deleted the table
|
// function modified or deleted the table
|
||||||
// value, so look it up again.
|
// value, so look it up again.
|
||||||
|
v_saved = v;
|
||||||
v = tbl->Lookup(k);
|
v = tbl->Lookup(k);
|
||||||
|
|
||||||
if ( ! v )
|
if ( ! v )
|
||||||
{ // user-provided function deleted it
|
{ // user-provided function deleted it
|
||||||
|
v = v_saved;
|
||||||
delete k;
|
delete k;
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue