3 ms·
Does rust zero the allocated memory? If IIRC, that was the crux of heartbleed(I wrote my own exploit based of the description).. It created a too large not-zer
by Rapzid 12y ago
Does rust zero the allocated memory? If IIRC, that was the crux of heartbleed(I wrote my own exploit based of the description).. It created a too large not-zeroed buffer based on the size supplied and not the actual size sent. So you could send 16bytes and specify 16k(or whatever it was) and you'd get back a bunch of extra crap from the not-zeroed memory. Previously used and now freed memory, not just any old memory.
In ANY case, if you build it(unsafe) they will come. People WILL be writing code using unsafe.
- kibwen 12y ago> People WILL be writing code using unsafe. Yes, and that's not in any way controversial. If it wasn't useful to be able to drop down and do anything that C can do, it wouldn't be in the language. Our job as a community is to foster a culture where `unsafe` blocks are viewed with scrutiny and distrust unless proven otherwise. Our job as library implementors is to determine which use cases cause people to reach for `unsafe` and encapsulate those patterns in well-vetted safe interfaces. Servo already has a bot that inspects each PR in the queue and raises an alarm if any code within an `unsafe` block has been modified, flagging it for very close review. This is not a feature that we take lightly, it is a necessary tool to be used with care.