Apologies for the strange title, this is one of those questions I can't find through a Google search just because I don't even know what I'm supposed to be searching for.
As I understand it, programs are ultimately compiled into binary which is then run by a computer.
So say, for example, you have a simple program which takes a user input and then executes some code -- when compiled into binary, there must be some sort of 'signature' that signifies the end of the user input so the computer knows where it ends. Say just for the sake of this example it's something simple like 0110. So after the user has input his data it might look like ...1100 0101 0110 1010 1001..., where the 0110 signifies the end of the string so the computer knows it's ended and that the rest is code from the program.
But what if the user input contained the same signature? Say the user input, after conversion to binary, came out to be ...0110 0010 0110 1010 1001... What is there to prevent the user from 'tricking' the computer into thinking the user input has ended, and then running malicious code now that the PC believes it's part of the program and not the string?
Hope this question makes any sort of sense, I'd be incredibly grateful if someone could explain this to me. It seems so trivial but it's been bugging me that I can't find an answer for it.