Injection, when data becomes code

SQL injection and shell command injection share one flaw with the buffer overflow, untrusted input reaching a place where it is read as code or control data, and the defence is to keep the two apart with parameterised queries, argument lists instead of shell strings and bounded copies.

From Computer Networks and Security.