1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
|
BASH PATCH REPORT
=================
Bash-Release: 4.3
Patch-ID: bash43-020
Bug-Reported-by: Jared Yanovich <slovichon@gmail.com>
Bug-Reference-ID: <20140417073654.GB26875@nightderanger.psc.edu>
Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-04/msg00065.html
Bug-Description:
When PS2 contains a command substitution, here-documents entered in an
interactive shell can sometimes cause a segmentation fault.
Patch (apply with `patch -p0'):
*** ../bash-4.3-patched/shell.h 2012-12-25 21:11:01.000000000 -0500
--- shell.h 2014-06-03 09:24:28.000000000 -0400
***************
*** 169,173 ****
int expand_aliases;
int echo_input_at_read;
!
} sh_parser_state_t;
--- 169,174 ----
int expand_aliases;
int echo_input_at_read;
! int need_here_doc;
!
} sh_parser_state_t;
*** ../bash-4.3-patched/parse.y 2014-05-14 09:16:40.000000000 -0400
--- parse.y 2014-04-30 09:27:59.000000000 -0400
***************
*** 2643,2647 ****
r = 0;
! while (need_here_doc)
{
parser_state |= PST_HEREDOC;
--- 2643,2647 ----
r = 0;
! while (need_here_doc > 0)
{
parser_state |= PST_HEREDOC;
***************
*** 6076,6079 ****
--- 6076,6080 ----
ps->expand_aliases = expand_aliases;
ps->echo_input_at_read = echo_input_at_read;
+ ps->need_here_doc = need_here_doc;
ps->token = token;
***************
*** 6124,6127 ****
--- 6125,6129 ----
expand_aliases = ps->expand_aliases;
echo_input_at_read = ps->echo_input_at_read;
+ need_here_doc = ps->need_here_doc;
FREE (token);
*** ../bash-4.3-patched/y.tab.c 2014-04-07 11:56:12.000000000 -0400
--- y.tab.c 2014-07-30 09:55:57.000000000 -0400
***************
*** 4955,4959 ****
r = 0;
! while (need_here_doc)
{
parser_state |= PST_HEREDOC;
--- 5151,5155 ----
r = 0;
! while (need_here_doc > 0)
{
parser_state |= PST_HEREDOC;
***************
*** 8388,8391 ****
--- 8584,8588 ----
ps->expand_aliases = expand_aliases;
ps->echo_input_at_read = echo_input_at_read;
+ ps->need_here_doc = need_here_doc;
ps->token = token;
***************
*** 8436,8439 ****
--- 8633,8637 ----
expand_aliases = ps->expand_aliases;
echo_input_at_read = ps->echo_input_at_read;
+ need_here_doc = ps->need_here_doc;
FREE (token);
*** ../bash-4.3/patchlevel.h 2012-12-29 10:47:57.000000000 -0500
--- patchlevel.h 2014-03-20 20:01:28.000000000 -0400
***************
*** 26,30 ****
looks for to find the patch level (for the sccs version string). */
! #define PATCHLEVEL 19
#endif /* _PATCHLEVEL_H_ */
--- 26,30 ----
looks for to find the patch level (for the sccs version string). */
! #define PATCHLEVEL 20
#endif /* _PATCHLEVEL_H_ */
|