News for hackers. Stuff that matters.
Re:Variable Length Arrays are problematic by josefx on Tuesday July 06, 2021 @01:47AM (#27744603)
> Well, the difference is in possibility of checking the value returned by malloc() and thus being able to, for example, inform the user about the error

Not on Linux. Memory over commit means that you get a pointer pointing to nowhere^1 . Your program will simply fail when it traverses the allocated address range the first time and the OS ends up unable to allocate enough memory pages to back the address range.

1 unless you exceed the total existing memory+swap space in a single allocation

There are no comments on this comment yet.