1
0

122-upstream-bash43-022.patch 1.4 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. BASH PATCH REPORT
  2. =================
  3. Bash-Release: 4.3
  4. Patch-ID: bash43-022
  5. Bug-Reported-by: scorp.dev.null@gmail.com
  6. Bug-Reference-ID: <E1WxXw8-0007iE-Bi@pcm14>
  7. Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-06/msg00061.html
  8. Bug-Description:
  9. Using nested pipelines within loops with the `lastpipe' option set can result
  10. in a segmentation fault.
  11. Patch (apply with `patch -p0'):
  12. --- a/execute_cmd.c
  13. +++ b/execute_cmd.c
  14. @@ -2413,7 +2413,16 @@ execute_pipeline (command, asynchronous,
  15. #endif
  16. lstdin = wait_for (lastpid);
  17. #if defined (JOB_CONTROL)
  18. - exec_result = job_exit_status (lastpipe_jid);
  19. + /* If wait_for removes the job from the jobs table, use result of last
  20. + command as pipeline's exit status as usual. The jobs list can get
  21. + frozen and unfrozen at inconvenient times if there are multiple pipelines
  22. + running simultaneously. */
  23. + if (INVALID_JOB (lastpipe_jid) == 0)
  24. + exec_result = job_exit_status (lastpipe_jid);
  25. + else if (pipefail_opt)
  26. + exec_result = exec_result | lstdin; /* XXX */
  27. + /* otherwise we use exec_result */
  28. +
  29. #endif
  30. unfreeze_jobs_list ();
  31. }
  32. --- a/patchlevel.h
  33. +++ b/patchlevel.h
  34. @@ -25,6 +25,6 @@
  35. regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
  36. looks for to find the patch level (for the sccs version string). */
  37. -#define PATCHLEVEL 21
  38. +#define PATCHLEVEL 22
  39. #endif /* _PATCHLEVEL_H_ */