4
0
mirror of git://sourceware.org/git/newlib-cygwin.git synced 2025-02-24 17:47:46 +08:00
Terraneo Federico 987d040394 Lift 256 arg limit in execl, execle and execlp
add --enable-newlib-use-malloc-in-execl option

The previous version of these functions allocated a 256 entry array and
copied arguments in that array with no bound checking. That
implementation always occupied 1024 bytes of stack for the array even in
the common case in which the number of passed arguments is far less than
256, risking stack overflows in environments with small stacks, and
caused a stack buffer overflow if called with more than 256 arguments.

The improved implementation counts the actual number of passed arguments
and allocates a suitable buffer. The default implementation uses alloca
to allocate the buffer to satisfy the POSIX.1-2008 requirement that
execl and execle should be callable from signal handlers, but it is
possible to override this behavior and use malloc for targets where the
risk of stack overflow due to unbounded stack allocations is a more
pressing requirement than the corner case of allowing execl calls from
signal handlers.
2025-02-03 12:43:51 +01:00
..
2018-01-17 11:47:26 -06:00
2018-01-17 11:47:26 -06:00
2018-10-11 08:29:16 +02:00
2018-01-17 11:47:26 -06:00
2018-01-17 11:47:26 -06:00
2018-01-17 11:47:26 -06:00
2024-08-20 14:42:03 +02:00
2018-01-17 11:47:26 -06:00
2018-01-17 11:47:26 -06:00
2022-08-31 15:18:08 -04:00
2022-08-31 15:18:08 -04:00