I am trying to run a buffer overflow example to run some code, but the problem is that when I try to run the code just to get a buffer overflow, Windows throws a prompt up stating "Program has stopped working, Windows is checking for a solution to the program. So when I try to make sure it just has a overflow by one byte. The program just runs, but doesn't pause the command window in order for me to see the segmentation fault error address. Which to my understanding I would need in order to change it and make it run my desired window as the passed parameter.Here is the simple program.
#define BUF_LEN 5
int main(int argc, char **argv)
{
char buf[BUF_LEN];
if (argc > 1)
{
strcpy(buf, argv[1]);
}
return 0;
printf(buf);
system("pause");
}