Just a quick note this morning to share something I found while
finishing up SafeInt 3.0. This is something more helpful with
64-bit porting than with general security, though it does have
some security side effects. Warning - heavy C++ programming geek
content ahead -  If you declare a function like so:  bool Foo(
unsigned long ul )  And then pass in a size_t, you'll be
truncating when you start compiling the code as 64-bit. The
compiler will warn you about this, but if you had done:
unsigned long cbSomething; bool Baz( unsigned short s );  And
then passed cbSomething to Baz, it gets truncated, and the
compiler won't be any help about it. Similarly, if we passed a
signed short to Foo, it gets sign extended, then cast to
unsigned, potentially changing the value. The compiler won't
warn about that, either. Given that integer mayhem figures
strongly in both security issues and is job #1 in terms of doing
a port to 64-bit, this standard behavior is less than ideal.
One of the things people asked for in SafeInt