title: Understanding and doing Code Injection in C
body: <p>I am a bit confused in the idea of code injection in C.  If somebody could explain it and show how its done I would appreciate it.</p>
  
  <p>So lets say in C you have some Char array of size 512 which is being written to the contents of a socket of length 1024, and that char array now holds some sort of code but only half of what was written.</p>
  
  <p>How is the malicious code executed in a buffer overflow, I think I am confused on the process structure(stack, heap, data, text).   </p>