3 ms·
This is from the python-cryptography package: https://cryptography.io/en/latest/faq/#why-does-cryptography-require-rust https://cryptography.io/en/latest/faq/#
by justinsaccount 3y ago
This is from the python-cryptography package: https://cryptography.io/en/latest/faq/#why-does-cryptography-require-rust https://cryptography.io/en/latest/faq/#why-does-cryptography...
- dehrmann 3y agoIs there a C replacement language that's lightweight and provides just enough guardrails to avoid buffer overflows? Or some sort of static analysis on top of modern C++ that can give you Rust-like safety?
- nneonneo 3y agoPeople have been developing “safer” C/C++ extensions for literally decades. Very few of them have caught on, and those that did are usually in niche applications. Rust is the best shot at a safe C/C++ replacement language. Buffer overflows should be relatively easy to avoid in modern code, but some C programmers insist on doing handrolled calculations for buffer sizes that wind up being wrong (the WebP vuln was a great example of this), and not having buffer length checks because they assume their calculations are right (it’s faster!). But buffer overflows are a small part of the vulnerability space. For instance, memory allocation bugs, like double free/use-after-free are much more insidious with large codebases, and harder to detect due to problems like unclear or undocumented ownership. C doesn’t provide any mechanism for communicating ownership or lifetime information for all but the simplest objects, leaving this up to the programmer to manage.