6 ms·
It is worth noting, that all three CVEs could be prevented by simple bounds checking at runtime. Preventing them does not require borrow checker or any other Ru
by delamon 1y ago
It is worth noting, that all three CVEs could be prevented by simple bounds checking at runtime. Preventing them does not require borrow checker or any other Rust fancy features.
- pdimitar 1y agoIt is also worth noting that theoreticals don't help such discussions either. Yes, C programmers can do much more checks. The reality on the ground is -- they do not. Forcing checks by the compiler seems to be the only historically proven method of making programmers pay more attention. If you can go out there and make _all_ C code utilize best-in-class static checkers, by all means, go and do so. The world would be a much better place.
- delamon 1y agoCorrect. Any language with builtin bounds checking would work.
- pdimitar 1y agoIf your only criteria is "remove the buffer under- and over-flows", yes. IMO Rust helps with a few more things. Its strong static typing allows for certain gymnastics to make invalid states unrepresentable. Though in fairness, that is sometimes taken too far and makes the code hard to maintain. Tradeoffs, as always.
- steveklabnik 1y agoIf it was simple to prevent, then why was it not prevented?