News for hackers. Stuff that matters.
Re:C99 doesn't need function bodies, or 'VLAs are Turing com... by jasonhansel on Thursday August 04, 2022 @03:50PM (#32347457)
Doesn't a similar DoS risk (from allowing users to allocate arbitrarily large amounts of memory) also apply to the heap? You shouldn't be giving arbitrary user-supplied ints to malloc either.
Re:C99 doesn't need function bodies, or 'VLAs are Turing com... by lelanthran on Thursday August 04, 2022 @04:02PM (#32347603)
> Doesn't a similar DoS risk (from allowing users to allocate arbitrarily large amounts of memory) also apply to the heap?

DoS Risk? No one cares too much about that - the problem with VLAs is stack smashing, which then allows aribtrary user-supplied code to be executed.

You cannot do that with malloc() and friends.

Re:C99 doesn't need function bodies, or 'VLAs are Turing com... by saagarjha on Thursday August 04, 2022 @07:53PM (#32349800)
VLAs don’t smash the stack.
Re:C99 doesn't need function bodies, or 'VLAs are Turing com... by pjmlp on Friday August 05, 2022 @04:46AM (#32353387)
Depends on the number you put inside, and the linker settings for stack size.
Re:C99 doesn't need function bodies, or 'VLAs are Turing com... by saagarjha on Friday August 05, 2022 @03:28PM (#32360821)
No.