freebsd-skq/bin/sh
jilles 3c6e58db4a sh: Fix crash if a -T trap is taken during command substitution.
Code like  t=$(stat -f %m "$file")  segfaulted if -T was active and a trap
was taken while the shell was waiting for the child process to finish.

What happened was that the dotrap() call in waitforjob() was hit. This
re-entered command execution (including expand.c) at a point not expected by
expbackq(), and global state (unallocated stack string and argbackq) was
corrupted.

To fix this, change expbackq() to prepare for command execution to be
re-entered.

Reported by:	bdrewery
MFC after:	1 week
2017-03-04 22:58:34 +00:00
..
bltin Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
funcs Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
tests sh: Fix crash if a -T trap is taken during command substitution. 2017-03-04 22:58:34 +00:00
alias.c Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
alias.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
arith_yacc.c sh: Remove two redundant (uintmax_t) casts. 2014-08-20 20:15:43 +00:00
arith_yacc.h sh: Fix compiler warnings related to duplicate or missing declarations. 2015-03-01 21:46:55 +00:00
arith_yylex.c sh: Fix compiler warnings related to duplicate or missing declarations. 2015-03-01 21:46:55 +00:00
arith.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
builtins.def Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
cd.c Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
cd.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
error.c Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
error.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
eval.c Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
eval.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
exec.c Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
exec.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
expand.c sh: Fix crash if a -T trap is taken during command substitution. 2017-03-04 22:58:34 +00:00
expand.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
histedit.c Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
input.c Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
input.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
jobs.c Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
jobs.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
mail.c Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
mail.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
main.c Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
main.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
Makefile bin: normalize paths using SRCTOP-relative paths or :H when possible 2017-03-04 11:31:08 +00:00
Makefile.depend DIRDEPS_BUILD: Regenerate without local dependencies. 2016-02-24 17:20:11 +00:00
memalloc.c Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
memalloc.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
miscbltin.c Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
mkbuiltins Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
mknodes.c Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
mksyntax.c Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
mktokens Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
myhistedit.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
mystring.c Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
mystring.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
nodes.c.pat Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
nodetypes Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
options.c Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
options.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
output.c Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
output.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
parser.c Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
parser.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
redir.c Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
redir.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
sh.1 Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
shell.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
show.c Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
show.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
TOUR
trap.c Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
trap.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
var.c Renumber copyright clause 4 2017-02-28 23:42:47 +00:00
var.h Renumber copyright clause 4 2017-02-28 23:42:47 +00:00