Open HeeillWang opened 9 months ago
It seems like there should be an assertion prior to the next_power_of_two
call, in addition to the one after it?
That would resolve #626 as well. Plus, consider to use checked_next_power_of_two
Thanks for detecting those! Would you like to submit a PR that uses an assertion or checked math?
submitted on #628
I executed fuzz testing on
http-0.2.9
, and found some arithmetic overflow. Please note that overflow condition is different with #626 .reproduce with :
If you input TOO big number on
with_capacity()
, #626 occurs before reaching tonext_power_of_two()
.