Cpp Coding Standards/SECURITY/ValInput
From Apache OpenOffice Wiki
The printable version is no longer supported and may have rendering errors. Please update your browser bookmarks and please use the default browser print function instead.
If your input comes from external, you must validate that input. Don't try to identify what's illegal and remove that from the input, do it the other way around: check what's legal (because you will likely forget cases of illegal input).
See also David Wheeler's excellent Secure Programming for Linux and Unix HOWTO.