What is an Integer Overflow?
Storing a value greater than maximum supported value is called integer overflow. Integer overflow on its own doesnt leads to arbitrary code execution, but an integer overflow might leads to stack overflow or heap overflow which could result in arbitrary code execution.
Data types Size and its range:
datatype size unsigned_range signed_range
char 1 0 to 255 -128 to 127
short 2 0 to 65535 -32768 to 32767
int 4 0 to 4294967296 -2147483648 to 2147483647
Integer underflow
Similarly storing a value lesser than the minimum supported value is called integer underflow. For example if we try to store-2147483649 to signed int data type, its gets wrapped around and stored as 21471483647. This is called integer underflow.
Strlen () ' s return type is size_t (unsigned int)
Linux (x86) Exploit Development Series 2: integer Overflow