I don’t think that casting a range of bits as some other arbitrary type “is a bug nobody sees coming”.

C++ compilers also warn you that this is likely an issue and will fail to compile if configured to do so. But it will let you do it if you really want to.

That’s why I love C++

  • Speiser0@feddit.org
    link
    fedilink
    arrow-up
    10
    ·
    24 hours ago

    You don’t even need unsafe, you can just take user input and execute it in a shell and rust will let you do it. Totally insecure!

    • Ignotum@lemmy.world
      link
      fedilink
      arrow-up
      14
      arrow-down
      1
      ·
      20 hours ago

      Rust isn’t memory safe because you can invoke another program that isn’t memory safe?

      • Speiser0@feddit.org
        link
        fedilink
        arrow-up
        7
        ·
        12 hours ago

        My comment is sarcastic, obviously. The argument Kairos gave is similar to this. You can still introduce vulnerabilities. The issue is normally that you introduce them accidentally. Rust gives you safety, but does not put your code into a sandbox. It looked to me like they weren’t aware of this difference.