Integer wraparound happens when a number grows past the maximum value its variable can store and “rolls over” to a much smaller value, often zero or a near-zero number. In security-sensitive code, that can make a length, counter, or allocation size look valid when it is not.
This matters because attackers can use wraparound to bypass bounds checks, trigger undersized allocations, or corrupt memory. Kernel code, parsers, and packet-processing paths are especially sensitive: if a length field wraps, later logic may validate the wrong value and then operate on too little space. Defenders look for strict range checks, safe arithmetic routines, fuzzing, and code review of size calculations to prevent wraparound bugs from becoming crashes or privilege escalation.


