4 ms·
> It was caused by failing to validate untrusted input. Rust isn't going to help you with that. Really? Validation and sanitization are the last, not the firs
by atemerev 9y ago
> It was caused by failing to validate untrusted input. Rust isn't going to help you with that.
Really?
Validation and sanitization are the last, not the first line of defense. It is not about erecting barriers, it is about failure modes. All your software components, from core to border, should fail fast, safe and in a predictable way -- the exact opposite of what happens in C.
In any sane programming language (e.g. Java -- not particularly sane, but boring enough) Heartbleed would have resulted, at worst, in OutOfBoundsException or similar, and the only damage would have been the denial of service. And to do bounds checking, you don't need to have garbage collector -- it is the most basic thing the runtime can do, and performance penalty is minimal. Why it is customary to skip this in C/C++, I don't know.
Lack of bounds checking, not pointer arithmetic or allocation lifecycle, is the major source of security issues with existing software.
- pcwalton 9y ago> Lack of bounds checking, not pointer arithmetic or allocation lifecycle, is the major source of security issues with existing software. No, this is not true. Use after free is more pernicious nowadays.
- iso-8859-1 9y agoBounds checking is not customary because it is more work. It is more work because arrays in C degrade to pointers, which do not know their length. This is because C was designed on a PDP-7 with 8k RAM. Original Pascal had only fixed size arrays/strings and it was a problem. http://cm.bell-labs.com/who/dmr/chist.html http://cm.bell-labs.com/who/dmr/chist.html