Source code from the Hunting Memory Bugs article.