]> git.ipfire.org Git - thirdparty/glibc.git/commit
Fix segfault in maybe_script_execute.
authorStefan Liebler <stli@linux.ibm.com>
Thu, 6 Sep 2018 12:27:03 +0000 (14:27 +0200)
committerStefan Liebler <stli@linux.ibm.com>
Mon, 10 Sep 2018 12:27:40 +0000 (14:27 +0200)
commitc5c90b480e4f21ed1d28e0e6d942b06b8d9e8bd7
tree67f7ac2e5fab097b6111079d45d149cc17876845
parent174709d879a15590e00119c7f91dc2460aaf571c
Fix segfault in maybe_script_execute.

If glibc is built with gcc 8 and -march=z900,
the testcase posix/tst-spawn4-compat crashes with a segfault.

In function maybe_script_execute, the new_argv array is dynamically
initialized on stack with (argc + 1) elements.
The function wants to add _PATH_BSHELL as the first argument
and writes out of bounds of new_argv.
There is an off-by-one because maybe_script_execute fails to count
the terminating NULL when sizing new_argv.

ChangeLog:

* sysdeps/unix/sysv/linux/spawni.c (maybe_script_execute):
Increment size of new_argv by one.

(cherry picked from commit 28669f86f6780a18daca264f32d66b1428c9c6f1)
ChangeLog
sysdeps/unix/sysv/linux/spawni.c