I had a drawn out email email describing passing by value and the function’s need to only perform size_t multiplication overload checking but not only do you not care I don’t think it’s worth my time to merely succeed in angering you. I love your work!
On Thu, Feb 18, 2021 at 7:10 PM Theo de Raadt <dera...@openbsd.org> wrote: > Luke Small <lukensm...@gmail.com> wrote: > > > However, calloc(ptr, nmemb, size) may have been called using smaller int > > variable types which would overflow when multiplied. > > In which case the allocation would not have succeeded. > > Where if the variables > > storing the values passed to nmemb and size are less than or especially > > equal to their original values, I think it’d be good to state that: > > Huh? > > > freezero(ptr, (size_t)nmemb * (size_t)size); > > is guaranteed to work, but > > freezero(ptr, nmemb * size); > > does not have that guarantee. > > I hope I never run any software by you. > -- -Luke