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:
Jon Siwek 2019-01-14 10:26:47 -06:00
commit 02783692d8
3 changed files with 8 additions and 1 deletions

View file

@ -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
* Reorganize documentation index (Jon Siwek, Corelight)

View file

@ -1 +1 @@
2.6-62
2.6-66

View file

@ -2348,6 +2348,7 @@ void TableVal::DoExpire(double t)
HashKey* k = 0;
TableEntryVal* v = 0;
TableEntryVal* v_saved = 0;
for ( int i = 0; i < table_incremental_step &&
(v = tbl->NextEntry(k, expire_cookie)); ++i )
@ -2371,10 +2372,12 @@ void TableVal::DoExpire(double t)
// It's possible that the user-provided
// function modified or deleted the table
// value, so look it up again.
v_saved = v;
v = tbl->Lookup(k);
if ( ! v )
{ // user-provided function deleted it
v = v_saved;
delete k;
continue;
}