Sanitize user input

From Rosetta Code
Revision as of 23:27, 7 September 2021 by Puppydrum64 (talk | contribs) (Created page with "{{draft task|Text processing}} "Never trust user input." If the Super Mario Bros. 3 Wrong Warp or https://www.explainxkcd.com/wiki/index.php/Little_Bobby_Tables| Bobby Tabl...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)
Sanitize user input is a draft programming task. It is not yet considered ready to be promoted as a complete task, for reasons that should be found in its talk page.

"Never trust user input." If the Super Mario Bros. 3 Wrong Warp or [Bobby Tables] have taught programmers anything, it's that user input can be dangerous in unexpected ways.

Task

Create a function that takes a list of 20 first and last names, and copies them to a record or struct. The list of names won't be provided here, because exploits like the Bobby Tables one are often language-specific. Try to show an example of a "Bobby Tables" style input in your list of names and how your function prevents it from being executed at runtime.