Detecting memory corruption with dog tags

Posted on 2016-05-08

There's a fantastic technique I've used in my C days that attempted to detect memory corruption. It's a cheap and usually effective technique because it relies on common causes of corruption, namely off by one or any bound writes into memory beyond your allocated limit or even pointer arithmetic gone a-rye. It works by whenever you allocate memory you write a tag at the start and end. This can be anything but should be big enough such that it's unlikely...

Continue Reading