Skip to content

add calloc integer overflow check

Check for integer overflow in the size calculation in calloc().

Added a test using SIZE_MAX, SIZE_MAX as arguments, expecting a null pointer as output. As the overflowing result of SIZE_MAX*SIZE_MAX is just 1, the null pointer can be reasonably expected not to originate from an underlying failed malloc() call.

Merge request reports