LWN.net Logo

Are they using the right technology?

Are they using the right technology?

Posted May 28, 2012 6:52 UTC (Mon) by ncm (subscriber, #165)
In reply to: Are they using the right technology? by foom
Parent article: A Tale of Two Pwnies (Part 1)

Unsigned ints don't overflow. They implement well-defined modular arithmetic. No operations on unsigned int yield undefined results.

If anybody actually had any use for range-checked C, that mode in Gcc would work. Likewise, array bounds checking. The reason that people don't have any use for them is that they would fail to catch the overwhelming majority of overflow and overindexing bugs. A program that fails to keep a short int less than 32768 is a program that also fails to keep it below 10000. A program that overindexes its built-in arrays also overindexes variable-sized storage.


(Log in to post comments)

Are they using the right technology?

Posted May 28, 2012 13:25 UTC (Mon) by nix (subscriber, #2304) [Link]

Unsigned ints don't overflow. They implement well-defined modular arithmetic. No operations on unsigned int yield undefined results.
... which, if unexpected, can be and often is a security hole. You haven't solved anything.

Copyright © 2013, Eklektix, Inc.
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds