summaryrefslogtreecommitdiffstats
path: root/source/a/bash/bash-5.1-patches/bash51-014
blob: cd8df23ab445817d50f8b754ba05e0bdcffa3a07 (plain) (blame)
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
			     BASH PATCH REPORT
			     =================

Bash-Release:	5.1
Patch-ID:	bash51-014

Bug-Reported-by:	platon7pronko@gmail.com
Bug-Reference-ID:
Bug-Reference-URL:	https://savannah.gnu.org/patch/?10035

Bug-Description:

Bash may produce corrupted input if a multibyte character spans a 512-byte
boundary while reading the output of a command substitution.

Patch (apply with `patch -p0'):

*** ../bash-20210217/subst.c	2021-02-03 10:32:08.000000000 -0500
--- subst.c	2021-03-01 16:47:52.000000000 -0500
***************
*** 6243,6247 ****
  	  /* punt on the hard case for now */
  	  memset (&ps, '\0', sizeof (mbstate_t));
! 	  mblen = mbrtowc (&wc, bufp-1, bufn+1, &ps);
  	  if (MB_INVALIDCH (mblen) || mblen == 0 || mblen == 1)
  	    istring[istring_index++] = c;
--- 6243,6247 ----
  	  /* punt on the hard case for now */
  	  memset (&ps, '\0', sizeof (mbstate_t));
! 	  mblen = mbrtowc (&wc, bufp-1, bufn, &ps);
  	  if (MB_INVALIDCH (mblen) || mblen == 0 || mblen == 1)
  	    istring[istring_index++] = c;

*** ../bash-5.1/patchlevel.h	2020-06-22 14:51:03.000000000 -0400
--- patchlevel.h	2020-10-01 11:01:28.000000000 -0400
***************
*** 26,30 ****
     looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 13
  
  #endif /* _PATCHLEVEL_H_ */
--- 26,30 ----
     looks for to find the patch level (for the sccs version string). */
  
! #define PATCHLEVEL 14
  
  #endif /* _PATCHLEVEL_H_ */