import tcsh-6.20.00-12.el8

This commit is contained in:
CentOS Sources 2020-01-21 16:40:08 -05:00 committed by Stepan Oksanichenko
parent 48631976da
commit 7467db05d0
3 changed files with 107 additions and 1 deletions

View File

@ -0,0 +1,48 @@
From 1ef6e9d0eef9278829f863fff55755b7a5415b81 Mon Sep 17 00:00:00 2001
From: Christos Zoulas <christos@zoulas.com>
Date: Fri, 11 Jan 2019 10:49:54 -0500
Subject: [PATCH] Abort history loading on long lines
diff --git a/sh.lex.c b/sh.lex.c
index fee790a..e945795 100644
--- a/sh.lex.c
+++ b/sh.lex.c
@@ -145,6 +145,7 @@ lex(struct wordent *hp)
struct wordent *wdp;
eChar c;
int parsehtime = enterhist;
+ int toolong = 0;
histvalid = 0;
histline.len = 0;
@@ -179,6 +180,8 @@ lex(struct wordent *hp)
wdp = new;
wdp->word = word(parsehtime);
parsehtime = 0;
+ if (enterhist && toolong++ > 10 * 1024)
+ stderror(ERR_LTOOLONG);
} while (wdp->word[0] != '\n');
cleanup_ignore(hp);
cleanup_until(hp);
@@ -291,9 +294,12 @@ word(int parsehtime)
Char hbuf[12];
int h;
int dolflg;
+ int toolong = 0;
cleanup_push(&wbuf, Strbuf_cleanup);
loop:
+ if (enterhist && toolong++ > 256 * 1024)
+ seterror(ERR_WTOOLONG);
while ((c = getC(DOALL)) == ' ' || c == '\t')
continue;
if (cmap(c, _META | _ESC))
@@ -352,6 +358,8 @@ word(int parsehtime)
c1 = 0;
dolflg = DOALL;
for (;;) {
+ if (enterhist && toolong++ > 256 * 1024)
+ seterror(ERR_WTOOLONG);
if (c1) {
if (c == c1) {
c1 = 0;

View File

@ -0,0 +1,47 @@
From 83c5be028419b3f27c3cc707b88fb21bfa4e1b11 Mon Sep 17 00:00:00 2001
From: zoulasc <christos@zoulas.com>
Date: Sat, 19 Oct 2019 08:52:53 -0400
Subject: [PATCH] FIx PR/113: failing -c command causes infinite loop
diff --git a/sh.c b/sh.c
index 4b5c624..dd87172 100644
--- a/sh.c
+++ b/sh.c
@@ -237,6 +237,7 @@ main(int argc, char **argv)
int nofile = 0;
volatile int nverbose = 0;
volatile int rdirs = 0;
+ volatile int exitcode = 0;
int quitit = 0;
Char *cp;
#ifdef AUTOLOGOUT
@@ -1390,6 +1391,12 @@ main(int argc, char **argv)
if (targinp) {
+ /* If this -c command caused an error before, skip processing */
+ if (reenter && arginp) {
+ exitcode = 1;
+ goto done;
+ }
+
arginp = SAVE(targinp);
/*
* we put the command into a variable
@@ -1422,6 +1429,7 @@ main(int argc, char **argv)
*/
process(setintr);
+done:
/*
* Mop-up.
*/
@@ -1443,7 +1451,7 @@ main(int argc, char **argv)
}
record();
exitstat();
- return (0);
+ return exitcode;
}
void

View File

@ -13,7 +13,7 @@
Name: tcsh
Summary: An enhanced version of csh, the C shell
Version: 6.20.00
Release: 9%{?dist}
Release: 12%{?dist}
License: BSD
URL: http://www.tcsh.org/
@ -52,6 +52,8 @@ 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
Patch009: tcsh-6.20.00-009-fix-regexp-for-backlash-quoting-tests.patch
Patch010: tcsh-6.20.00-010-fix-memory-consumption-while-loading-corrupted-history.patch
Patch011: tcsh-6.20.00-011-fix-infinite-loop-after-ctrlC.patch
# Downstream patches -- these should be always included when doing rebase:
@ -186,6 +188,15 @@ fi
# =============================================================================
%changelog
* Fri Nov 01 2019 Jan Macku <jamacku@redhat.com> - 6.20.00-12
- rebuilt
* Fri Nov 01 2019 Jan Macku <jamacku@redhat.com> - 6.20.00-11
- rebuilt
* Thu Oct 31 2019 Jan Macku <jamacku@redhat.com> - 6.20.00-10
- fix for rapid memory consumption caused by corrupted history (#1765649)
* Fri Feb 09 2018 Fedora Release Engineering <releng@fedoraproject.org> - 6.20.00-9
- Rebuilt for https://fedoraproject.org/wiki/Fedora_28_Mass_Rebuild