I know I keep harping on about integer arithmetic issues; however, my co-author David LeBlanc, has written a great article about the issue, as well as provided a templated C++ class called SafeInt to make life, well, a little more secure! Enjoy: here.