summaryrefslogtreecommitdiff
path: root/data/bash/bash44-019
blob: 081e9793290f669db06c3a29b0a035d8a1dd99ad (plain)
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
			     BASH PATCH REPORT
			     =================

Bash-Release:	4.4
Patch-ID:	bash44-019

Bug-Reported-by:	Kieran Grant <kieran.thehacker.grant@gmail.com>
Bug-Reference-ID:	<ec9071ae-efb1-9e09-5d03-e905daf2835c@gmail.com>
Bug-Reference-URL:	http://lists.gnu.org/archive/html/bug-bash/2018-02/msg00002.html

Bug-Description:

With certain values for PS1, especially those that wrap onto three or more
lines, readline will miscalculate the number of invisible characters,
leading to crashes and core dumps.

Patch (apply with `patch -p0'):

*** ../bash-4.4.18/lib/readline/display.c	2016-07-28 14:49:33.000000000 -0400
--- lib/readline/display.c	2018-02-03 19:19:35.000000000 -0500
***************
*** 772,776 ****
        wadjust = (newlines == 0)
  		  ? prompt_invis_chars_first_line
! 		  : ((newlines == prompt_lines_estimate) ? wrap_offset : prompt_invis_chars_first_line);
  
        /* fix from Darin Johnson <darin@acuson.com> for prompt string with
--- 788,794 ----
        wadjust = (newlines == 0)
  		  ? prompt_invis_chars_first_line
! 		  : ((newlines == prompt_lines_estimate)
! 		  	? (wrap_offset - prompt_invis_chars_first_line)
! 		  	: 0);
  
        /* fix from Darin Johnson <darin@acuson.com> for prompt string with
*** ../bash-4.4/patchlevel.h	2016-06-22 14:51:03.000000000 -0400
--- patchlevel.h	2016-10-01 11:01:28.000000000 -0400
***************
*** 26,30 ****
     looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 18
  
  #endif /* _PATCHLEVEL_H_ */
--- 26,30 ----
     looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 19
  
  #endif /* _PATCHLEVEL_H_ */