This is a live mirror of the Perl 5 development currently hosted at https://github.com/perl/perl5
make exec keep its argument list more reliably
authorZefram <zefram@fysh.org>
Wed, 6 Dec 2017 21:27:15 +0000 (21:27 +0000)
committerZefram <zefram@fysh.org>
Thu, 14 Dec 2017 22:48:30 +0000 (22:48 +0000)
commit282fc0b3cc2439f69587d980b62bef7f5d5bdfef
tree6dc6abf858b4903d0adb99d6309a74f84ebf7782
parente135ff695231a81e2a70a739e8d813525432fd4d
make exec keep its argument list more reliably

Bits of exec code were putting the constructed commands into globals
PL_Argv and PL_Cmd, which could then be clobbered by reentrancy.
These are only global in order to manage their freeing, but that's
better managed by using the scope stack.  So replace them with automatic
variables, with ENTER/SAVEFREEPV/LEAVE to free the memory.  Also copy
the strings acquired from SVs, to avoid magic clobbering the buffers of
SVs already read.  Fixes [perl #129888].
14 files changed:
amigaos4/amigaio.c
cygwin/cygwin.c
djgpp/djgpp.c
doio.c
embed.fnc
embed.h
embedvar.h
intrpvar.h
os2/os2.c
pp_sys.c
proto.h
sv.c
util.c
vms/vms.c