Catch invalid values of the false-positive rate.

This commit is contained in:
Matthias Vallentin 2013-06-06 13:13:36 -07:00
parent 012e09c5c4
commit f211b856c9

View file

@ -5751,6 +5751,11 @@ function anonymize_addr%(a: addr, cl: IPAddrAnonymizationClass%): addr
function bloomfilter_init%(fp: double, capacity: count,
max: count &default=1%): opaque of bloomfilter
%{
if ( fp < 0.0 || fp > 1.0 )
{
reporter->Error("false-positive rate must take value between 0 and 1");
return NULL;
}
BloomFilter* bf;
if ( max == 1 )
{