&gt; <i>It is possible to write provably correct code.</i><p>... and then someone finds a bug in the <i>specification</i> which is provably correctly implemented.<p>Using gets() to read the input can be provably correct. All you have to do is remove any requirements for security from the program&#x27;s specification, and specify that the program will always be used in circumstances when the expected input datum will be less than a certain length.<p>... and then the hardware is buggy or failing. That RAM bit flips and you&#x27;re screwed. The machine as a whole isn&#x27;t provably correct.