Re:Catching integer overflows in C
by olliej on Wednesday August 22, 2018 @12:36AM
(#17816334)
Yup you are right on that, but the obvious way to check for overflow is UB so gets optimized out. Many security bugs in code people thought was correct. The correct, standard compliant non-UB way to check for the overflow requires a zero check and a division. It’s super non obvious. I like to imagine C committee has made standardized definition for the current builtins but I also have low expectations.
[ Parent
| on HN ]
There are no comments on this comment yet.