3 ms·
You're right, there isn't a classic simple buffer overrun that Rust would trivially catch, but you're missing two things: 1) The problem was really sending bac
by rkangel 10y ago
You're right, there isn't a classic simple buffer overrun that Rust would trivially catch, but you're missing two things:
1) The problem was really sending back uninitialised memory. In Rust you can't have uninitialised memory. The oversize allocated buffer would have to have initialisation data passed in (possibly zeroes)
2) You'd never write the Rust code like that anyway. The abstractions avaialble mean that you aren't separating the content of some data and the length to pass to allocators.