1 | BASH PATCH REPORT |
---|
2 | ================= |
---|
3 | |
---|
4 | Bash-Release: 4.3 |
---|
5 | Patch-ID: bash43-009 |
---|
6 | |
---|
7 | Bug-Reported-by: Matthias Klose <doko@debian.org> |
---|
8 | Bug-Reference-ID: <53346FC8.6090005@debian.org> |
---|
9 | Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2014-03/msg00171.html |
---|
10 | |
---|
11 | Bug-Description: |
---|
12 | |
---|
13 | There is a problem with unsigned sign extension when attempting to reallocate |
---|
14 | the input line when it is fewer than 3 characters long and there has been a |
---|
15 | history expansion. The sign extension causes the shell to not reallocate the |
---|
16 | line, which results in a segmentation fault when it writes past the end. |
---|
17 | |
---|
18 | Patch (apply with `patch -p0'): |
---|
19 | |
---|
20 | *** ../bash-4.3-patched/parse.y 2014-02-11 09:42:10.000000000 -0500 |
---|
21 | --- parse.y 2014-03-27 16:33:29.000000000 -0400 |
---|
22 | *************** |
---|
23 | *** 2425,2429 **** |
---|
24 | if (shell_input_line_terminator != EOF) |
---|
25 | { |
---|
26 | ! if (shell_input_line_size < SIZE_MAX && shell_input_line_len > shell_input_line_size - 3) |
---|
27 | shell_input_line = (char *)xrealloc (shell_input_line, |
---|
28 | 1 + (shell_input_line_size += 2)); |
---|
29 | --- 2425,2429 ---- |
---|
30 | if (shell_input_line_terminator != EOF) |
---|
31 | { |
---|
32 | ! if (shell_input_line_size < SIZE_MAX-3 && (shell_input_line_len+3 > shell_input_line_size)) |
---|
33 | shell_input_line = (char *)xrealloc (shell_input_line, |
---|
34 | 1 + (shell_input_line_size += 2)); |
---|
35 | *** ../bash-4.3-patched/y.tab.c 2014-03-28 11:17:06.000000000 -0400 |
---|
36 | --- y.tab.c 2014-04-07 11:48:31.000000000 -0400 |
---|
37 | *************** |
---|
38 | *** 4737,4741 **** |
---|
39 | if (shell_input_line_terminator != EOF) |
---|
40 | { |
---|
41 | ! if (shell_input_line_size < SIZE_MAX && shell_input_line_len > shell_input_line_size - 3) |
---|
42 | shell_input_line = (char *)xrealloc (shell_input_line, |
---|
43 | 1 + (shell_input_line_size += 2)); |
---|
44 | --- 4737,4741 ---- |
---|
45 | if (shell_input_line_terminator != EOF) |
---|
46 | { |
---|
47 | ! if (shell_input_line_size < SIZE_MAX-3 && (shell_input_line_len+3 > shell_input_line_size)) |
---|
48 | shell_input_line = (char *)xrealloc (shell_input_line, |
---|
49 | 1 + (shell_input_line_size += 2)); |
---|
50 | *** ../bash-4.3/patchlevel.h 2012-12-29 10:47:57.000000000 -0500 |
---|
51 | --- patchlevel.h 2014-03-20 20:01:28.000000000 -0400 |
---|
52 | *************** |
---|
53 | *** 26,30 **** |
---|
54 | looks for to find the patch level (for the sccs version string). */ |
---|
55 | |
---|
56 | ! #define PATCHLEVEL 8 |
---|
57 | |
---|
58 | #endif /* _PATCHLEVEL_H_ */ |
---|
59 | --- 26,30 ---- |
---|
60 | looks for to find the patch level (for the sccs version string). */ |
---|
61 | |
---|
62 | ! #define PATCHLEVEL 9 |
---|
63 | |
---|
64 | #endif /* _PATCHLEVEL_H_ */ |
---|