Advanced Math Analysis
Buffer overflow, with a strcmp() check.
Problem
Solution
char response[50];
setbuf(stdout, NULL);
setbuf(stdin, NULL);
setbuf(stderr, NULL);
...
gets(response);
if (strcmp(response, "i pledge to not cheat")) {
puts("I'm sorry, but you did not type out the honor pledge.");
puts("This obviously means that you are a cheater.");
puts("And we certainly cannot have that.");
puts("Goodbye.");
exit(1);
}




Last updated