Secure Coding in C · advanced · ~10 min
Never pass user input as a format string.
printf(user_input) is a classic vulnerability: if the user types %x%x%x%n, printf reads (and possibly writes) past the call's actual arguments.
Always pass user data as an argument to a fixed format: printf("%s", user_input). Compile with -Wformat -Wformat-security to catch the mistake.
// BAD
printf(user_input);
// GOOD
printf("%s", user_input);