Integer overflow: Difference between revisions

Content deleted Content added
Origin: actual max representable value for 128 bit
Security ramifications: Typo correction.
Line 17:
 
==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 causescause its value to wrap and become negative, violating the assumption contained in the program and perhaps leading 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.
 
Some languages, such as [[Lisp (programming language)|Lisp]] and [[Ada (programming language)|Ada]], provide mechanisms that, if used, result in accidental overflow triggering an exception condition (interrupt?). Many languages do not support such functionality.