harden/codeql/samples/integer_overflow/main.c

15 lines
195 B
C
Raw Normal View History

2023-02-17 17:54:08 +00:00
#include <stdio.h>
#include <stdlib.h>
int sum(int a, int b) { return a + b; }
int main() {
int x = 2147483647;
int y = 2;
int z = x + sum(y, y);
printf("z = %d\n", z);
return 0;
}