dynamically allocating on the stack

Cym13 cpicard at openmailbox.org
Sat Apr 21 14:25:58 UTC 2018


On Saturday, 21 April 2018 at 13:54:14 UTC, H. S. Teoh wrote:
> 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

Wait, why? Don't they share the same address space and grow in 
opposite directions?


More information about the Digitalmars-d-learn mailing list