mirror of
https://github.com/zeek/zeek.git
synced 2025-10-07 00:58:19 +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
|
@ -186,7 +186,10 @@ function bloomfilter_merge%(bf1: opaque of bloomfilter,
|
|||
const BloomFilterVal* bfv1 = static_cast<const BloomFilterVal*>(bf1);
|
||||
const BloomFilterVal* bfv2 = static_cast<const BloomFilterVal*>(bf2);
|
||||
|
||||
if ( ! same_type(bfv1->Type(), bfv2->Type()) )
|
||||
if ( ( bfv1->Type() != bfv2->Type() ) && // both 0 is ok
|
||||
(bfv1->Type() != 0) &&
|
||||
(bfv2->Type() != 0) &&
|
||||
! same_type(bfv1->Type(), bfv2->Type()) )
|
||||
{
|
||||
reporter->Error("incompatible Bloom filter types");
|
||||
return 0;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue