Integer Overflow
Example 1: C
Vulnerable Code:
Reason for vulnerability: Adding 1 to the maximum integer value, causing overflow.
Fixed Code:
Reason for fix: Check for overflow before performing the addition.
Example 2: Java
Vulnerable Code:
Reason for vulnerability: Adding 1 to the maximum integer value, causing overflow.
Fixed Code:
Reason for fix: Check for overflow before performing the addition.
Last updated