Problem: The four-argument CBloomFilter constructor is used by unit tests and the fuzz target to exercise Bloom filter sizing directly.
Zero elements make the hash-function calculation divide by zero.
The size calculation converts its floating-point result to unsigned int before applying the protocol limit, which is undefined for zero or invalid false-positive rates and for valid parameters whose calculated size exceeds the integer range.
Fix: Require false-positive rates in [0, 1], construct the existing empty match-all state for zero elements, and use the largest permitted filter for a zero rate with positive elements.
Clamp the calculated size before its integer conversion so large valid inputs remain within the protocol limit.