Hacker News new | ask | show | jobs
by Ygg2 4439 days ago
If you wrote OpenSSL in Rust, it would avoid bugs like Heartbleed.

If you called OpenSSL from Rust, it would be the same as calling C from Java.

Gist of issue, Rust's static type checker would prevent bugs that caused HeartBleed.

1 comments

> Rust's static type checker would prevent bugs that caused HeartBleed

I believe its more a case that it would have been a run-time error due to Rust's automatic bounds checking. This is because Rust uses 'fat pointers' for strings, vectors and slices that include bounds information rather than a single, raw pointer like in C. Do note there are unsafe ways around bounds checking, but these are restricted to unsafe blocks, which makes them easier to audit.