An unintentional-looking but crash-causing bug
C, linux. Crashes system if run as root

/* Fork child process, wait 5 seconds and kill it */
pid_t pid = fork();
if(pid =! 0) {
    /* Parent */
    sleep(5);
    kill(pid, 11);
}
else {
    /* Child process. Would contain some code */
}


By changing != to =!, an innocent comparison is turned into an assignment. And given that pid 1 is init, and killing init causes a kernel panic, this is not code you would want to run as root :)