Fix memory corruption while parsing functions

Resolves: #1451057
This commit is contained in:
Siteshwar Vashisht 2017-05-29 13:44:23 +02:00
parent 75c67d3437
commit 57f52a14f2
2 changed files with 21 additions and 1 deletions

View File

@ -0,0 +1,12 @@
diff --git a/src/cmd/ksh93/sh/parse.c b/src/cmd/ksh93/sh/parse.c
--- a/src/cmd/ksh93/sh/parse.c
+++ b/src/cmd/ksh93/sh/parse.c
@@ -742,7 +742,7 @@ static Shnode_t *funct(Lex_t *lexp)
register Shnode_t *t;
register int flag;
struct slnod *volatile slp=0;
- Stak_t *savstak;
+ Stak_t *volatile savstak=0;
Sfoff_t first, last;
struct functnod *volatile fp;
Sfio_t *iop;

View File

@ -8,7 +8,7 @@ URL: http://www.kornshell.com/
#CPL everywhere else (for KSH itself)
License: CPL
Version: %{releasedate}
Release: 34%{?dist}
Release: 35%{?dist}
Source0: http://www.research.att.com/~gsf/download/tgz/ast-ksh.%{release_date}.tgz
Source1: http://www.research.att.com/~gsf/download/tgz/INIT.%{release_date}.tgz
Source2: kshcomp.conf
@ -184,6 +184,9 @@ Patch76: ksh-20120801-kia.patch
# rhbz#1417886
Patch77: ksh-20120801-iso8859.patch
# rhbz#1451057
Patch78: ksh-20120801-syntax-error.patch
Conflicts: pdksh
Requires: coreutils, diffutils, chkconfig
BuildRequires: bison
@ -260,6 +263,7 @@ with "sh" (the Bourne Shell).
%patch75 -p1 -b .F_dupfd_cloexec
%patch76 -p1 -b .kia
%patch77 -p1 -b .iso8859
%patch78 -p1 -b .syntax-error
#/dev/fd test does not work because of mock
sed -i 's|ls /dev/fd|ls /proc/self/fd|' src/cmd/ksh93/features/options
@ -365,6 +369,10 @@ fi
%config(noreplace) %{_sysconfdir}/binfmt.d/kshcomp.conf
%changelog
* Mon May 29 2017 Siteshwar Vashisht <svashisht@redhat.com> - 20120801-35
- Fix memory corruption while parsing functions
Resolves: #1451057
* Tue Apr 25 2017 Siteshwar Vashisht <svashisht@redhat.com> - 20120801-34
- Fix parsing of iso8859 characters
Resolves: #1417886