do not crash when two subseguent dots are used in variable or command name (#733544)

This commit is contained in:
Michal Hlavinka 2011-12-07 14:43:43 +01:00
parent 04c2322595
commit 6acaf4cd5e
2 changed files with 19 additions and 1 deletions

View File

@ -0,0 +1,12 @@
diff -up ksh-20110630/src/cmd/ksh93/include/nval.h.ddotfix ksh-20110630/src/cmd/ksh93/include/nval.h
--- ksh-20110630/src/cmd/ksh93/include/nval.h.ddotfix 2011-12-07 14:31:31.793236351 +0100
+++ ksh-20110630/src/cmd/ksh93/include/nval.h 2011-12-07 14:32:26.357677922 +0100
@@ -198,7 +198,7 @@ struct Namval
/* name-value pair macros */
#define nv_isattr(np,f) ((np)->nvflag & (f))
-#define nv_onattr(n,f) ((n)->nvflag |= (f))
+#define nv_onattr(n,f) ((n)?((n)->nvflag |= (f)):(f))
#define nv_offattr(n,f) ((n)->nvflag &= ~(f))
#define nv_isarray(np) (nv_isattr((np),NV_ARRAY))

View File

@ -6,7 +6,7 @@ URL: http://www.kornshell.com/
Group: System Environment/Shells Group: System Environment/Shells
License: CPL License: CPL
Version: 20110630 Version: 20110630
Release: 7%{?dist} Release: 8%{?dist}
Source0: http://www.research.att.com/~gsf/download/tgz/ast-ksh.%{releasedate}.tgz Source0: http://www.research.att.com/~gsf/download/tgz/ast-ksh.%{releasedate}.tgz
Source1: http://www.research.att.com/~gsf/download/tgz/INIT.%{releasedate}.tgz Source1: http://www.research.att.com/~gsf/download/tgz/INIT.%{releasedate}.tgz
Source3: kshrc.rhs Source3: kshrc.rhs
@ -32,6 +32,8 @@ Patch6: ksh-20110630-joblimit.patch
Patch7: ksh-20110630-dontstop.patch Patch7: ksh-20110630-dontstop.patch
Patch8: ksh-20110630-ddotfix.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
Conflicts: pdksh Conflicts: pdksh
Requires: coreutils, glibc-common, diffutils Requires: coreutils, glibc-common, diffutils
@ -57,6 +59,7 @@ with "sh" (the Bourne Shell).
%patch5 -p1 -b .tmoutfix %patch5 -p1 -b .tmoutfix
%patch6 -p1 -b .joblimit %patch6 -p1 -b .joblimit
%patch7 -p1 -b .dontstop %patch7 -p1 -b .dontstop
%patch8 -p1 -b .ddotfix
#/dev/fd test does not work because of mock #/dev/fd test does not work because of mock
sed -i 's|ls /dev/fd|ls /proc/self/fd|' src/cmd/ksh93/features/options sed -i 's|ls /dev/fd|ls /proc/self/fd|' src/cmd/ksh93/features/options
@ -142,6 +145,9 @@ fi
rm -rf $RPM_BUILD_ROOT rm -rf $RPM_BUILD_ROOT
%changelog %changelog
* Wed Dec 07 2011 Michal Hlavinka <mhlavink@redhat.com> - 20110630-8
- do not crash when two subseguent dots are used in variable or command name (#733544)
* Mon Dec 05 2011 Michal Hlavinka <mhlavink@redhat.com> - 20110630-7 * Mon Dec 05 2011 Michal Hlavinka <mhlavink@redhat.com> - 20110630-7
- fix: ksh can prematurely exit without crash or any error - fix: ksh can prematurely exit without crash or any error
- make spec work in epel - make spec work in epel