• 0 Posts
  • 10 Comments
Joined 1 year ago
cake
Cake day: July 27th, 2023

help-circle

  • This is a use-after-free, which should be impossible in safe Rust due to the borrow checker. The only way for this to happen would be incorrect unsafe code (still possible, but dramatically reduced code surface to worry about) or a compiler bug. To allocate heap space in safe Rust, you have to use types provided by the language like Box, Rc, Vec, etc. To free that space (in Rust terminology, dropping it by using drop() or letting it go out of scope) you must be the owner of it and there may be current borrows (i.e. no references may exist). Once the variable is droped, the variable is dead so accessing it is a compiler error, and the compiler/std handles freeing the memory.

    There’s some extra semantics to some of that but that’s pretty much it. These kind of memory bugs are basically Rust’s raison d’etre - it’s been carefully designed to make most memory bugs impossible without using unsafe. If you’d like more information I’d be happy to provide!







  • sleep_deprived@lemmy.worldtoMemes@lemmy.mlThis community lately
    link
    fedilink
    arrow-up
    63
    arrow-down
    4
    ·
    1 year ago

    Typically this thinking is mostly correct - e.g. Manifest v3 - but not in this case. If websites see enough users using chormium, via user agent or other fingerprinting, they’ll be more willing to require WEI. And unlike Manifest v3 etc. this affects the whole web, not just users of one browser or the other.

    In every case monopolies are bad. Including in tech.