News for hackers. Stuff that matters.
Re:Cap'n'Proto remote vuln: pointer overflow check optimized... by caf on Friday April 21, 2017 @08:50AM (#14165060)
The code in question is not ill-defined over all inputs - it has well-defined behaviour as long as the offset in question doesn't exceed the size of the object that it is being used to address.
Re:Cap'n'Proto remote vuln: pointer overflow check optimized... by lawnchair_larry on Friday April 21, 2017 @01:21PM (#14167440)
Actually, invoking undefined behavior anywhere in the code, even unreachable code, means the entire program is invalid. Including for all inputs. The reason it doesn't simply abort is because compiler authors don't go out of their way to do extra work for no reason.
Re:Cap'n'Proto remote vuln: pointer overflow check optimized... by zAy0LfpBZLC8mAC on Friday April 21, 2017 @02:01PM (#14167764)
> Actually, invoking undefined behavior anywhere in the code, even unreachable code, means the entire program is invalid.

Erm ... nope. If code is unreachable, it can, by definition, not exhibit undefined behaviour.

> The reason it doesn't simply abort is because compiler authors don't go out of their way to do extra work for no reason.

Well, true, but the primary reason is that there are parts of the input domain for which the behaviour of the code is actually defined, and it's not defined to mean a call to abort(). The mere possibility to call some code at runtime with values for which the behaviour is undefined does not make the code's semantics completely undefined.