You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

vulnerable.java 465 B

2 years ago
1234567891011121314151617181920212223242526
  1. package integer.overflow;
  2. /**
  3. *
  4. * @author justi
  5. */
  6. public class IntegerOverflow {
  7. /**
  8. * @param args the command line arguments
  9. */
  10. public static void main(String[] args) {
  11. //int a is equal to the largest int available
  12. int a = Integer.MAX_VALUE;
  13. int b = 1;
  14. //calculation will result in integer overflow
  15. int c = a + b;
  16. System.out.println(a + " + " + b + " = " + c);
  17. }
  18. }

No Description

Contributors (1)