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)
This commit is contained in:
David Kaspar [Dee'Kej] 2017-02-28 19:00:07 +01:00
parent 66e48a26a8
commit cbac8752ec
2 changed files with 34 additions and 1 deletions

View File

@ -0,0 +1,28 @@
From 2309245d647853442f6a5450130f56499698176e Mon Sep 17 00:00:00 2001
From: Christos Zoulas <christos@zoulas.com>
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

View File

@ -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] <dkaspar@redhat.com> - 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 <releng@fedoraproject.org> - 6.20.00-4
- Rebuilt for https://fedoraproject.org/wiki/Fedora_26_Mass_Rebuild