Re:Cap'n'Proto remote vuln: pointer overflow check optimized...
by kouteiheika on Saturday April 22, 2017 @12:18PM
(#14173199)
> I read that Rust for example only has run-time checks in the debug version, which to me is disappointing.
Only by default; you can turn them on in release builds too if you want. (And Rust 1.17 will have a stable `-C overflow-checks=y` flag which allows you to turn on the overflow checks without other debug assertions.)
Re:Cap'n'Proto remote vuln: pointer overflow check optimized...
by lmm on Monday April 24, 2017 @04:57AM
(#14182830)
> a class like CSafeInt should cover all integer overflow bugs with run-time checks
If that's all you want it's easy to do that in any language? What's so special about C++? The reason this gets talked about more in C++ is that the consequences of integer overflow in C++ are dreadful (undefined behaviour i.e. instant security bug) whereas in most languages adding two integers will evaluate to an integer.
The problem is that almost no one is thinking about this class of bugs. Furthermore, few languages offer tools to detect and handle integer overflows; I read that Rust for example only has run-time checks in the debug version, which to me is disappointing.