]> git.ipfire.org Git - thirdparty/make.git/commit
[SV 64124] Avoid stack overflows for large command lines
authorPaul Smith <psmith@gnu.org>
Mon, 19 Jun 2023 14:00:11 +0000 (10:00 -0400)
committerPaul Smith <psmith@gnu.org>
Mon, 19 Jun 2023 17:27:50 +0000 (13:27 -0400)
commit04f4c2b8d95e895270b612b5ea3841ee4d3dcc26
treec87cbf142b35e5a6042d4c61170409c47468e1c5
parent347316fdf615763be64b09e707fb8d6b35188826
[SV 64124] Avoid stack overflows for large command lines

Modify areas dealing with large command lines to use the heap rather
than relying on alloca / stack space.

* src/main.c (main): Allocate potentially large buffers with xmalloc.
(decode_env_switches): Ditto.
* src/function.c (func_error): Replace alloca with xmalloc/free.
* tests/scripts/features/expand: Add a newline for readable diffs.
src/function.c
src/main.c
tests/scripts/features/expand