diff --git a/tcsh-6.20.00-008-guard-ascii-only-reversion.patch b/tcsh-6.20.00-008-guard-ascii-only-reversion.patch new file mode 100644 index 0000000..6d1cecd --- /dev/null +++ b/tcsh-6.20.00-008-guard-ascii-only-reversion.patch @@ -0,0 +1,43 @@ +From 8e6dfd53321a0b0047f7d75db21a946c166c600b Mon Sep 17 00:00:00 2001 +From: Christos Zoulas +Date: Fri, 17 Feb 2017 11:17:27 -0500 +Subject: [PATCH] Unfortunately the AsciiOnly reversion causes a SEGV because + *ch is used to index in the command array, and now contains INVALID_BYTE. env + -i ./tcsh b + +--- + ed.inputl.c | 18 +++++++++++------- + 1 file changed, 11 insertions(+), 7 deletions(-) + +diff --git a/ed.inputl.c b/ed.inputl.c +index f543a6f..1a0d356 100644 +--- a/ed.inputl.c ++++ b/ed.inputl.c +@@ -796,13 +796,17 @@ GetNextChar(Char *cp) + return -1; + } + } +- cbp++; +- if (normal_mbtowc(cp, cbuf, cbp) == -1) { +- reset_mbtowc(); +- if (cbp < MB_CUR_MAX) +- continue; /* Maybe a partial character */ +- /* And drop the following bytes, if any */ +- *cp = (unsigned char)*cbuf | INVALID_BYTE; ++ if (AsciiOnly) { ++ *cp = (unsigned char)*cbuf; ++ } else { ++ cbp++; ++ if (normal_mbtowc(cp, cbuf, cbp) == -1) { ++ reset_mbtowc(); ++ if (cbp < MB_CUR_MAX) ++ continue; /* Maybe a partial character */ ++ /* And drop the following bytes, if any */ ++ *cp = (unsigned char)*cbuf | INVALID_BYTE; ++ } + } + break; + } +-- +2.9.3 + diff --git a/tcsh.spec b/tcsh.spec index f2df5d4..6833ea5 100644 --- a/tcsh.spec +++ b/tcsh.spec @@ -49,6 +49,7 @@ Patch004: tcsh-6.20.00-004-do-not-use-old-pointer-tricks.patch Patch005: tcsh-6.20.00-005-reset-fixes-numbering.patch Patch006: tcsh-6.20.00-006-cleanup-in-readme-files.patch Patch007: tcsh-6.20.00-007-look-for-tgetent-in-libtinfo.patch +Patch008: tcsh-6.20.00-008-guard-ascii-only-reversion.patch # Downstream patches -- these should be always included when doing rebase: @@ -181,6 +182,7 @@ fi tcsh-6.20.00-005-reset-fixes-numbering.patch tcsh-6.20.00-006-cleanup-in-readme-files.patch tcsh-6.20.00-007-look-for-tgetent-in-libtinfo.patch + tcsh-6.20.00-008-guard-ascii-only-reversion.patch * Sat Feb 11 2017 Fedora Release Engineering - 6.20.00-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild