I swear I'm better than Copper IV!

Integer overflow: Origin

The register width of a processor determines the range of values that can be represented. Typical binary register widths for unsigned integers include: 8 bits: maximum representable value 28 − 1 = 255 16 bits: maximum representable value 216 − 1 = 65,535 32 bits: maximum representable value 232 − 1 = 4,294,967,295 (the most common width for personal computers as of 2005), 64 bits: maximum representable value 264 − 1 = 18,446,744,073,709,551,615 (the most common width for personal computer CPUs, as of 2017), 128 bits: maximum representable value 2128 − 1 = 340,282,366,920,938,463,463,374,607,431,768,211,455 When an arithmetic operation produces a result larger than the maximum above for a N-bit integer, an overflow reduces the result to modulo N-th power of 2, retaining only the least significant bits of the result and effectively causing a wrap around. In particular, multiplying or adding two integers may result in a value that is unexpectedly small, and subtracting from a small integer may cause a wrap to a large positive value (for example, 8-bit integer addition 255 + 2 results in 1, which is 257 mod 28, and similarly subtraction 0 − 1 results in 255, a two's complement representation of −1). Such wrap around may cause security problems – if an overflown value is used as the number of bytes to allocate for a buffer, the buffer will be allocated unexpectedly small, leading to a potential buffer overflow and arbitrary code execution.


[ PM | Exclude me | Exclude from subreddit | FAQ / Information | Source ] Downvote to remove | v0.22

/r/Rainbow6 Thread Parent Link - i.redd.it