mirror of
https://https.git.savannah.gnu.org/git/bash.git
synced 2026-07-13 15:10:49 +02:00
Bash-5.1 patch 14: fix off-by-one error when reading multibyte characters from command substitution output
This commit is contained in:
+1
-1
@@ -25,6 +25,6 @@
|
||||
regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh
|
||||
looks for to find the patch level (for the sccs version string). */
|
||||
|
||||
#define PATCHLEVEL 13
|
||||
#define PATCHLEVEL 14
|
||||
|
||||
#endif /* _PATCHLEVEL_H_ */
|
||||
|
||||
@@ -6242,7 +6242,7 @@ read_comsub (fd, quoted, flags, rflag)
|
||||
/* read a multibyte character from buf */
|
||||
/* punt on the hard case for now */
|
||||
memset (&ps, '\0', sizeof (mbstate_t));
|
||||
mblen = mbrtowc (&wc, bufp-1, bufn+1, &ps);
|
||||
mblen = mbrtowc (&wc, bufp-1, bufn, &ps);
|
||||
if (MB_INVALIDCH (mblen) || mblen == 0 || mblen == 1)
|
||||
istring[istring_index++] = c;
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user