dynamically allocating on the stack

H. S. Teoh hsteoh at quickfur.ath.cx
Sat Apr 21 13:54:14 UTC 2018


On Sat, Apr 21, 2018 at 01:30:55PM +0000, Cym13 via Digitalmars-d-learn wrote:
> On Saturday, 21 April 2018 at 12:08:09 UTC, Dmitry Olshansky wrote:
[...]
> > Unbounded allocation on stack is kind of anti-pattern and a
> > potential DoS vector.
> 
> I'm having trouble seeing how unbounded heap allocations aren't
> equally a potential DoS vector.
[...]

Generally speaking, the heap is much bigger than the stack (often many
times so) and so is less prone to overflow.  Though it's true, it still
does happen if you just blindly allocate memory based on unsanitized
external input.


T

-- 
My program has no bugs! Only unintentional features...


More information about the Digitalmars-d-learn mailing list