mirror of
https://github.com/zeek/zeek.git
synced 2025-10-17 14:08:20 +00:00
fix segfault that could be caused by merging an empty bloom-filter
with a bloom-filter already containing values. I assume that it is ok to merge an empty bloom-filter with any bloom-filter - if not we have to change the patch to return an error in this case.
This commit is contained in:
parent
af9e181731
commit
edb04e6d8b
4 changed files with 14 additions and 2 deletions
|
@ -17,6 +17,7 @@ error: false-positive rate must take value between 0 and 1
|
|||
1
|
||||
1
|
||||
1
|
||||
1
|
||||
2
|
||||
3
|
||||
3
|
||||
|
|
|
@ -45,6 +45,11 @@ function test_basic_bloom_filter()
|
|||
print bloomfilter_lookup(bf_merged, 84);
|
||||
print bloomfilter_lookup(bf_merged, 100);
|
||||
print bloomfilter_lookup(bf_merged, 168);
|
||||
|
||||
#empty filter tests
|
||||
local bf_empty = bloomfilter_basic_init(0.1, 1000);
|
||||
local bf_empty_merged = bloomfilter_merge(bf_merged, bf_empty);
|
||||
print bloomfilter_lookup(bf_empty_merged, 42);
|
||||
}
|
||||
|
||||
function test_counting_bloom_filter()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue