mirror of
https://github.com/zeek/zeek.git
synced 2025-10-07 00:58:19 +00:00
Fix bug when clearing Bloom filter contents.
This patch fixes a bug that occurred when calling the BiF bloomfilter_clear, which used to not only clear the underlying bit vector but also set its size to zero. As a result, subsequent element access or computations using the bit vector size caused erroneous behavior. Reported by @colonelxc.
This commit is contained in:
parent
9b672f9e7f
commit
cb4eaf762c
3 changed files with 5 additions and 5 deletions
|
@ -72,7 +72,7 @@ bool BasicBloomFilter::Empty() const
|
||||||
|
|
||||||
void BasicBloomFilter::Clear()
|
void BasicBloomFilter::Clear()
|
||||||
{
|
{
|
||||||
bits->Clear();
|
bits->Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BasicBloomFilter::Merge(const BloomFilter* other)
|
bool BasicBloomFilter::Merge(const BloomFilter* other)
|
||||||
|
@ -190,7 +190,7 @@ bool CountingBloomFilter::Empty() const
|
||||||
|
|
||||||
void CountingBloomFilter::Clear()
|
void CountingBloomFilter::Clear()
|
||||||
{
|
{
|
||||||
cells->Clear();
|
cells->Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
bool CountingBloomFilter::Merge(const BloomFilter* other)
|
bool CountingBloomFilter::Merge(const BloomFilter* other)
|
||||||
|
|
|
@ -75,9 +75,9 @@ bool CounterVector::AllZero() const
|
||||||
return bits->AllZero();
|
return bits->AllZero();
|
||||||
}
|
}
|
||||||
|
|
||||||
void CounterVector::Clear()
|
void CounterVector::Reset()
|
||||||
{
|
{
|
||||||
bits->Clear();
|
bits->Reset();
|
||||||
}
|
}
|
||||||
|
|
||||||
CounterVector::count_type CounterVector::Count(size_type cell) const
|
CounterVector::count_type CounterVector::Count(size_type cell) const
|
||||||
|
|
|
@ -86,7 +86,7 @@ public:
|
||||||
/**
|
/**
|
||||||
* Sets all counters to 0.
|
* Sets all counters to 0.
|
||||||
*/
|
*/
|
||||||
void Clear();
|
void Reset();
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Retrieves the number of cells in the storage.
|
* Retrieves the number of cells in the storage.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue