int main(int argc, char *argv[]) { char str[3]; str[0] = 'a'; str[1] = 'a'; int argv1; //a int from user char argv2[16]; // a array char from user argv1 = atoi(argv[1]); //simulate assign the value strcpy(argv2, argv[2] ); // klee_make_symbolic(argv2, 4, "argv2"); if(argc < 3 ) return -1; if(strcmp(argv2, "hello") == 0 ) printf("hello body \n"); else if(strcmp(argv2, "bug") == 0){ int_overflow(argv1); printf("Congratulations, a bug here\n"); } return 0; }
extern int str_int(const char *s, int *error) { int sign, uerror = 0; s = get_sign(s, &sign, error); unsigned long long val = str_ulong(s, &uerror); *error = *error || uerror || (val > MAX_UINT) || int_overflow(sign, val); return sign * val; }