mirror of
https://sourceware.org/git/glibc.git
synced 2025-08-01 10:06:57 +03:00
posix: Fix posix_spawn invalid memory access
Current Linux posix_spawn spawn do not test if the pid argument is valid before trying to update it for success case. This patch fixes it. Tested on x86_64 and i686. * sysdeps/unix/sysv/linux/spawni.c (__spawnix): Fix invalid memory access where posix_spawn success and pid argument is null. * posix/tst-spawn.c (do_test): Add posix_spawn null pid argument for success case.
This commit is contained in:
@ -381,7 +381,7 @@ __spawnix (pid_t * pid, const char *file,
|
||||
|
||||
close_not_cancel (args.pipe[0]);
|
||||
|
||||
if (!ec && new_pid)
|
||||
if (!ec && pid)
|
||||
*pid = new_pid;
|
||||
|
||||
__sigprocmask (SIG_SETMASK, &args.oldmask, 0);
|
||||
|
Reference in New Issue
Block a user