↓ Skip to main content

“While its primary purpose is to serve as The One True Debugger, printf(3) also happens to be Turing complete.”

Nicholas Carliniioccc.org ↗

A whole game of tic-tac-toe runs inside a single printf call in a loop. The format string does the logic. This is why security people get nervous about format string bugs. If printf can play a game, it can do whatever an attacker tells it to.