|
|
287226 |
BASH PATCH REPORT
|
|
|
287226 |
=================
|
|
|
287226 |
|
|
|
287226 |
Bash-Release: 4.2
|
|
|
287226 |
Patch-ID: bash42-043
|
|
|
287226 |
|
|
|
287226 |
Bug-Reported-by: konsolebox <konsolebox@gmail.com>
|
|
|
287226 |
Bug-Reference-ID: <CAJnmqwZuGKLgMsMwxRK4LL+2NN+HgvmKzrnode99QBGrcgX1Lw@mail.gmail.com>
|
|
|
287226 |
Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2013-01/msg00138.html
|
|
|
287226 |
|
|
|
287226 |
Bug-Description:
|
|
|
287226 |
|
|
|
287226 |
When SIGCHLD is trapped, and a SIGCHLD trap handler runs when a pending
|
|
|
287226 |
`read -t' invocation times out and generates SIGALRM, bash can crash with
|
|
|
287226 |
a segmentation fault.
|
|
|
287226 |
|
|
|
287226 |
Patch (apply with `patch -p0'):
|
|
|
287226 |
|
|
|
287226 |
*** ../bash-4.2-patched/builtins/read.def 2012-10-31 21:22:51.000517000 -0400
|
|
|
287226 |
--- builtins/read.def 2013-01-25 10:28:16.000038000 -0500
|
|
|
287226 |
***************
|
|
|
287226 |
*** 386,393 ****
|
|
|
287226 |
/* Tricky. The top of the unwind-protect stack is the free of
|
|
|
287226 |
input_string. We want to run all the rest and use input_string,
|
|
|
287226 |
! so we have to remove it from the stack. */
|
|
|
287226 |
! remove_unwind_protect ();
|
|
|
287226 |
! run_unwind_frame ("read_builtin");
|
|
|
287226 |
input_string[i] = '\0'; /* make sure it's terminated */
|
|
|
287226 |
retval = 128+SIGALRM;
|
|
|
287226 |
goto assign_vars;
|
|
|
287226 |
--- 386,403 ----
|
|
|
287226 |
/* Tricky. The top of the unwind-protect stack is the free of
|
|
|
287226 |
input_string. We want to run all the rest and use input_string,
|
|
|
287226 |
! so we have to save input_string temporarily, run the unwind-
|
|
|
287226 |
! protects, then restore input_string so we can use it later. */
|
|
|
287226 |
!
|
|
|
287226 |
input_string[i] = '\0'; /* make sure it's terminated */
|
|
|
287226 |
+ if (i == 0)
|
|
|
287226 |
+ {
|
|
|
287226 |
+ t = (char *)xmalloc (1);
|
|
|
287226 |
+ t[0] = 0;
|
|
|
287226 |
+ }
|
|
|
287226 |
+ else
|
|
|
287226 |
+ t = savestring (input_string);
|
|
|
287226 |
+
|
|
|
287226 |
+ run_unwind_frame ("read_builtin");
|
|
|
287226 |
+ input_string = t;
|
|
|
287226 |
retval = 128+SIGALRM;
|
|
|
287226 |
goto assign_vars;
|
|
|
287226 |
|
|
|
287226 |
*** ../bash-4.2-patched/patchlevel.h Sat Jun 12 20:14:48 2010
|
|
|
287226 |
--- patchlevel.h Thu Feb 24 21:41:34 2011
|
|
|
287226 |
***************
|
|
|
287226 |
*** 26,30 ****
|
|
|
287226 |
looks for to find the patch level (for the sccs version string). */
|
|
|
287226 |
|
|
|
287226 |
! #define PATCHLEVEL 42
|
|
|
287226 |
|
|
|
287226 |
#endif /* _PATCHLEVEL_H_ */
|
|
|
287226 |
--- 26,30 ----
|
|
|
287226 |
looks for to find the patch level (for the sccs version string). */
|
|
|
287226 |
|
|
|
287226 |
! #define PATCHLEVEL 43
|
|
|
287226 |
|
|
|
287226 |
#endif /* _PATCHLEVEL_H_ */
|