1 From http://ftp.gnu.org/pub/gnu/bash/bash-4.3-patches/bash43-041
3 Signed-off-by: Gustavo Zacarias <gustavo@zacarias.com.ar>
11 Bug-Reported-by: Hanno Böck <hanno@hboeck.de>
12 Bug-Reference-ID: <20150623131106.6f111da9@pc1>, <20150707004640.0e61d2f9@pc1>
13 Bug-Reference-URL: http://lists.gnu.org/archive/html/bug-bash/2015-06/msg00089.html,
14 http://lists.gnu.org/archive/html/bug-bash/2015-07/msg00018.html
18 There are several out-of-bounds read errors that occur when completing command
19 lines where assignment statements appear before the command name. The first
20 two appear only when programmable completion is enabled; the last one only
21 happens when listing possible completions.
23 Patch (apply with `patch -p0'):
25 *** a/bash-4.3.40/bashline.c 2014-12-29 14:39:43.000000000 -0500
26 --- b/bashline.c 2015-08-12 10:21:58.000000000 -0400
33 s = find_cmd_start (os);
34 e = find_cmd_end (end);
37 + /* Don't read past the end of rl_line_buffer */
43 + /* Or past point if point is within an assignment statement */
44 + else if (was_assignment && s > rl_point)
49 /* Skip over assignment statements preceding a command name. If we
50 don't find a command name at all, we can perform command name
51 *** a/bash-4.3.40/lib/readline/complete.c 2013-10-14 09:27:10.000000000 -0400
52 --- b/lib/readline/complete.c 2015-07-31 09:34:39.000000000 -0400
56 if (temp == 0 || *temp == '\0')
58 + else if (temp[1] == 0 && temp == pathname)
60 /* If the basename is NULL, we might have a pathname like '/usr/src/'.
61 Look for a previous slash and, if one is found, return the portion
62 *** a/bash-4.3/patchlevel.h 2012-12-29 10:47:57.000000000 -0500
63 --- b/patchlevel.h 2014-03-20 20:01:28.000000000 -0400
66 looks for to find the patch level (for the sccs version string). */
68 ! #define PATCHLEVEL 40
70 #endif /* _PATCHLEVEL_H_ */
72 looks for to find the patch level (for the sccs version string). */
74 ! #define PATCHLEVEL 41
76 #endif /* _PATCHLEVEL_H_ */