I have the following program in C, which triggers an overflow whenever the input integer is large enough. But I can not use AFL+ UBSAN to trigger this overflow automatically.
#include <stdio.h>
#include <stdlib.h>
#include <limits.h>
int main(void)
{
int x = 0;
if (scanf("%d", &x )!=1) return -1;
//e.g. x = INT_MAX can trigger integer overflow
x += 10000;
printf("x = %i\n", x);
return 0;
}
I have the following program in C, which triggers an overflow whenever the input integer is large enough. But I can not use AFL+ UBSAN to trigger this overflow automatically.
My command line is
afl-clang -fsanitize=undefined -fsanitize-undefined-trap-on-error ubsan.c \ && afl-fuzz -i /in -o out -- ./a.out