aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorChet Ramey <chet.ramey@case.edu>2019-11-25 00:34:21 +0100
committerVasyl Gello <vasek.gello@gmail.com>2019-11-26 20:25:33 +0000
commit7c65dd40610f036bcba1a053f2695f051a467dc1 (patch)
treec0687bced441b3f07ce996b96f23d73036ca2c38
parent89f4fe86c8e4b5f9ae0e9524b81bac1235cb01e8 (diff)
downloadandroid_external_bash-7c65dd40610f036bcba1a053f2695f051a467dc1.tar.gz
android_external_bash-7c65dd40610f036bcba1a053f2695f051a467dc1.tar.bz2
android_external_bash-7c65dd40610f036bcba1a053f2695f051a467dc1.zip
Bash-4.3 patch 43
When the lastpipe option is enabled, the last component can contain nested pipelines and cause a segmentation fault under certain circumestances. Change-Id: Idea7e968c7ade7cd1fd3e8f0054ec11d1051880d
-rw-r--r--execute_cmd.c12
-rw-r--r--patchlevel.h2
2 files changed, 11 insertions, 3 deletions
diff --git a/execute_cmd.c b/execute_cmd.c
index c8564a5..3ef0396 100644
--- a/execute_cmd.c
+++ b/execute_cmd.c
@@ -2405,9 +2405,17 @@ execute_pipeline (command, asynchronous, pipe_in, pipe_out, fds_to_close)
if (lastpipe_flag)
{
#if defined (JOB_CONTROL)
- append_process (savestring (the_printed_command), dollar_dollar_pid, exec_result, lastpipe_jid);
-#endif
+ if (INVALID_JOB (lastpipe_jid) == 0)
+ {
+ append_process (savestring (the_printed_command_except_trap), dollar_dollar_pid, exec_result, lastpipe_jid);
+ lstdin = wait_for (lastpid);
+ }
+ else
+ lstdin = wait_for_single_pid (lastpid); /* checks bgpids list */
+#else
lstdin = wait_for (lastpid);
+#endif
+
#if defined (JOB_CONTROL)
/* If wait_for removes the job from the jobs table, use result of last
command as pipeline's exit status as usual. The jobs list can get
diff --git a/patchlevel.h b/patchlevel.h
index 9b7b0e5..60eb423 100644
--- a/patchlevel.h
+++ b/patchlevel.h
@@ -25,6 +25,6 @@
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
looks for to find the patch level (for the sccs version string). */
-#define PATCHLEVEL 42
+#define PATCHLEVEL 43
#endif /* _PATCHLEVEL_H_ */