From cbac8752ec3d4f6ae2dfb64ea7ba7dc04c4b3996 Mon Sep 17 00:00:00 2001 From: "David Kaspar [Dee'Kej]" Date: Tue, 28 Feb 2017 19:00:07 +0100 Subject: [PATCH] tcsh-6.20.00-004-do-not-use-old-pointer-tricks.patch added > Don't play pointer tricks that are undefined in modern c (Brooks Davis) --- ...00-004-do-not-use-old-pointer-tricks.patch | 28 +++++++++++++++++++ tcsh.spec | 7 ++++- 2 files changed, 34 insertions(+), 1 deletion(-) create mode 100644 tcsh-6.20.00-004-do-not-use-old-pointer-tricks.patch diff --git a/tcsh-6.20.00-004-do-not-use-old-pointer-tricks.patch b/tcsh-6.20.00-004-do-not-use-old-pointer-tricks.patch new file mode 100644 index 0000000..6781b43 --- /dev/null +++ b/tcsh-6.20.00-004-do-not-use-old-pointer-tricks.patch @@ -0,0 +1,28 @@ +From 2309245d647853442f6a5450130f56499698176e Mon Sep 17 00:00:00 2001 +From: Christos Zoulas +Date: Wed, 7 Dec 2016 02:52:27 +0000 +Subject: [PATCH] Don't play pointer tricks that are undefined in modern c + (Brooks Davis) + +--- + tw.init.c | 3 +-- + 1 file changed, 1 insertion(+), 2 deletions(-) + +diff --git a/tw.init.c b/tw.init.c +index 68adbb9..d9525c5 100644 +--- a/tw.init.c ++++ b/tw.init.c +@@ -125,9 +125,8 @@ tw_str_add(stringlist_t *sl, size_t len) + sl->buff = xrealloc(sl->buff, sl->tbuff * sizeof(Char)); + /* Re-thread the new pointer list, if changed */ + if (ptr != NULL && ptr != sl->buff) { +- intptr_t offs = sl->buff - ptr; + for (i = 0; i < sl->nlist; i++) +- sl->list[i] += offs; ++ sl->list[i] = sl->buff + (sl->list[i] - ptr); + } + disabled_cleanup(&pintr_disabled); + } +-- +2.9.3 + diff --git a/tcsh.spec b/tcsh.spec index c92402c..e5fa4f5 100644 --- a/tcsh.spec +++ b/tcsh.spec @@ -1,7 +1,7 @@ Name: tcsh Summary: An enhanced version of csh, the C shell Version: 6.20.00 -Release: 4%{?dist} +Release: 5%{?dist} License: BSD URL: http://www.tcsh.org/ @@ -45,6 +45,7 @@ Patch000: tcsh-6.20.00-000-add-all-flags-for-gethost-build.patch Patch001: tcsh-6.20.00-001-delay-arginp-interpreting.patch Patch002: tcsh-6.20.00-002-type-of-read-in-prompt-confirm.patch Patch003: tcsh-6.20.00-003-fix-out-of-bounds-read.patch +Patch004: tcsh-6.20.00-004-do-not-use-old-pointer-tricks.patch # Downstream patches -- these should be always included when doing rebase: @@ -171,6 +172,10 @@ fi %changelog +* Tue Feb 28 2017 David Kaspar [Dee'Kej] - 6.20.00-5 +- Added multiple upstream patches: + tcsh-6.20.00-004-do-not-use-old-pointer-tricks.patch + * Sat Feb 11 2017 Fedora Release Engineering - 6.20.00-4 - Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild