Reply to post:

Rust in peace: Memory bugs in C and C++ code cause security issues so Microsoft is considering alternatives once again

Lee D Silver badge

That's fine. Use Rust.

And make sure you *never*, not even once, use an "unsafe" function in it.

Otherwise, you're just recreating C code poorly.

Now, how much of your code can be done? I imagine all of Office should be fine. But Windows, without unsafe Rust functions? Good luck!

The second you are into "dereferencing a raw pointer", memory safety of the whole shebang is at risk. Unfortunately, that's an inherently common requirement in operating systems, drivers, hardware interfaces of any kind, etc. and used greatly for performance tweaks too.

It's not that you couldn't do the same in any C variant either, whether by coding style, explicit compilation checks, or whatever. It works out the same.

As soon as you have to poke memory that you don't know the origin of, and trust what's there, and hope you got the address / size correct, and then interpret the data in that location in some fashion, you're in trouble. And, unfortunately, that's a inherent part of every OS.

POST COMMENT House rules

Not a member of The Register? Create a new account here.

  • Enter your comment

  • Add an icon

Anonymous cowards cannot choose their icon

SUBSCRIBE TO OUR WEEKLY TECH NEWSLETTER

Biting the hand that feeds IT © 1998–2019