4 ms·
Not in C. Rust is, as you say, intended to be memory safe. That means it has the hope of getting it right.
by AlyssaRowan 12y ago
Not in C. Rust is, as you say, intended to be memory safe.
That means it has the hope of getting it right.
- someone13 12y agoFWIW, you can implement the 'Drop' trait to provide a custom destructor, and then use, e.g. 'volatile_set_memory'[0] to zero out the memory of the object. This isn't subject to the same problems as C, AFAIK. [0] http://doc.rust-lang.org/std/intrinsics/fn.volatile_set_memory.html http://doc.rust-lang.org/std/intrinsics/fn.volatile_set_memo...
- strcat 12y agoYou would have to force the sensitive content to be dynamically allocated. All types in Rust can be moved via a shallow memcpy and that will leave around dead shallow copies. For example, `Vec<T>` will leave around dead versions of the values when it needs to do a reallocation that's not in-place.