I have the following code:
int main(int argc, char *argv[])
{
char ch[10];
printf(\"String 10 max. :: \"); gets( ch );
printf(\"String: %s\\n\", ch)
The effect of a buffer overrun depends entirely what you overwrite, what you overwrite it with, and how the overwritten data is subsequently used.
The method of buffer overrun exploitation involves using the overrun to modify the return address of a function; but returning from main() to the OS may not be quite the same as returning from a function.