Security Ramifications
In some situations, a program may make the assumption that a variable always contains a positive value. If the variable has a signed integer type, an overflow can cause its value to wrap and become negative. This overflow violates the program's assumption and may lead to unintended behavior. Similarly, subtracting from a small unsigned value may cause it to wrap to a large positive value which may also be an unexpected behavior. Multiplying or adding two integers may result in a value that is non-negative, but unexpectedly small. If this number 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.
Some languages, such as Ada (and certain variants of functional languages), provide mechanisms to make accidental overflows trigger an exception condition. In contrast, Python seamlessly converts a number that becomes too large for an integer to a long. (This occurred in Python 2.4.)
Read more about this topic: Integer Overflow
Famous quotes containing the word security:
“The horror of class stratification, racism, and prejudice is that some people begin to believe that the security of their families and communities depends on the oppression of others, that for some to have good lives there must be others whose lives are truncated and brutal.”
—Dorothy Allison (b. 1949)