This section is dedicated to the most egregious examples of code gone wrong.
A simple while loop turned into an eternal nightmare.
<script>
var i = 0;
while (i < 10) {
i++;
}
</script>
Why: Because someone forgot to break out of the loop. See the next example
A simple search function brought the entire system to its knees.
<script>
function findString(s) {
var re = /.*?/;
while (s.search(re) != -1) {
s = s.slice(s.search(re) + re.length);
}
}
</script>
Why: Because someone thought a non-capturing group would fix it. See the next example
A simple query turned into a never-ending cycle of despair.
<script>
db.query("SELECT * FROM table WHERE condition = 'true'");
</script>
Why: Because someone forgot to close the connection. See the next example