3 ms·
Not zero vulnerabilities, zero memory errors. Memory errors make a good share of vulnerabilities, but not all vulnerabilities are memory errors. And not all mem
by GuB-42 4y ago
Not zero vulnerabilities, zero memory errors. Memory errors make a good share of vulnerabilities, but not all vulnerabilities are memory errors. And not all memory errors are vulnerabilities, sometimes it is just an inexploitable bug.
It is to be expected that there is no bug in the very thing that Rust is supposed to prevent. The same can be said of Java, JS or even PHP. What surprises me a little though is that there is zero memory error even in unsafe Rust. There has to be some unsafe code somewhere, for low level data structures and things like that.
- carlmr 4y ago>What surprises me a little though is that there is zero memory error even in unsafe Rust. There has to be some unsafe code somewhere, for low level data structures and things like that. Even unsafe Rust has more strict typing and borrow checking which C++ doesn't have. It does allow raw pointers, but it's still safer than C++. The other thing is that if say 1% of your loc is unsafe Rust, it's much easier to put this under more scrutiny than the whole C++ codebase. And 1% is a lot if you ask me. I almost never need unsafe at all. >There has to be some unsafe code somewhere, for low level data structures and things like that. In most cases you can just use the standard library code for these. They do contain unsafe of course, but it's in one of the most battle tested places.