| ||
Check and limit the locale to valid values. (For more information, see David Wheelers Write It Secure: Format Strings and Locale Filtering listed in the Other Resources section below). Dont use the printf-family of functions if you can avoid it. For example, if youre using C++, use stream operators instead:
#include <iostream> //... std::cout << user_input //...