3 ms·
I'm not deep into Rust to try myself, but I meant something like type-level integers, perhaps to encode an buffer length, and then a sneaky trait or two that sp
by naasking 10y ago
I'm not deep into Rust to try myself, but I meant something like type-level integers, perhaps to encode an buffer length, and then a sneaky trait or two that specializes on particular (common) buffer sizes to manipulate the buffer in an exploitable way.
- steveklabnik 10y agoRust doesn't yet have type level integers, so that'll have to be saved for a future contest. (It's highly desired, and there's an RFC open, but it's not clear when they will land.) I like this idea though!
- mbrubeck 10y agoBut there are some crates like https://crates.io/crates/typenum https://crates.io/crates/typenum that implement type-level integers on top of the Rust type system, and quite a few other crates that then use these for things like array operations...
- Gankro 10y agoUsing typenum in production isn't a fireable offence?!
- naasking 10y agoNot natively, but you can do it via phantom type parameters. But that does raise an interesting question: could a malicious crate overload a "safe buffer" operation provided by another crate in this way?