Glossary
Integer overflow
An arithmetic result that exceeds the range of its integer type and wraps or triggers undefined behaviour, often producing undersized buffers (CWE-190).
An integer overflow (CWE-190) occurs when an arithmetic operation produces a value outside the range of its type. In C, unsigned arithmetic wraps modulo 2^N, while signed overflow is undefined behaviour that compilers may optimise around. Related failures include truncation to a narrower type and signedness confusion, where a negative length becomes a huge size_t.
The danger is what happens next: a wrapped count * size passed to malloc yields a small buffer that a later loop overflows. Prevent it with calloc, checked arithmetic (ckd_mul in C23 or __builtin_mul_overflow) and range checks; detect it with UBSan. See integer overflows and format strings.