News for hackers. Stuff that matters.
Re:size_t-to-int vulnerability in Linux’s filesystem layer by thayne on Tuesday July 20, 2021 @11:39PM (#27902092)
In rust you can't currently dynamically allocate on the stack, although that's probably something that will be added in the future. And as others have pointed out, allocating on the stack is a fairly reasonable optimization here.

I don't think you could even call strdupa through libc in rust. I would guess that strdupa is either a macro that uses the alloca compiler intrinsic or is itself a compiler intrinsic. Even if it isn't, it will break assumptions the rust compiler makes about the size of the stack frame.

There are no comments on this comment yet.