Re:C++ still isn't cutting it
by saagarjha on Monday October 19, 2020 @04:28AM
(#24824300)
> A malloc failure is not a unrecoverable error
It's not, but it's also a fairly difficult error to recover from effectively. You really need to know what you're doing to get out of this–I think someone did a study for how many STL implementations handled std::bad_alloc correctly (i.e. unwound and didn't accidentally take down the program) and I think the number was zero.
> we've collectively decided that we prefer to have 2,147,483,647 + 1 = -2,147,483,648
Not always, overflowing is often exploitable since it lets you bypass less than checks.
It's not, but it's also a fairly difficult error to recover from effectively. You really need to know what you're doing to get out of this–I think someone did a study for how many STL implementations handled std::bad_alloc correctly (i.e. unwound and didn't accidentally take down the program) and I think the number was zero.
> we've collectively decided that we prefer to have 2,147,483,647 + 1 = -2,147,483,648
Not always, overflowing is often exploitable since it lets you bypass less than checks.