int main(int argc, char *argv[argc]) {
char msg[] = "You ran the following command:";
char command_line[50];
/* copy argv[0] to command_line */
for (int i = 1; i < argc; ++i) {
/* append a space to command_line */
/* append argv[i] to command_line */
}
puts(msg);
puts(command_line);
return 0;
}
Run the program with slightly more than 50 characters of command line arguments. What happens? Recompile with -fsanitize=address,undefined
and run the program again.