Don't segfault when trying to bind int variable to array

with bad array subsrcipt.
Resolves: #618289

Signed-off-by: Roman Rakus <rrakus@redhat.com>
This commit is contained in:
Roman Rakus 2010-12-01 17:26:56 +01:00
parent 3333c5eedf
commit 0a8ef715f0
2 changed files with 23 additions and 1 deletions

View File

@ -0,0 +1,12 @@
diff -up bash-4.1/variables.c.Ai bash-4.1/variables.c
--- bash-4.1/variables.c.Ai 2010-07-28 08:42:54.000000000 +0200
+++ bash-4.1/variables.c 2010-07-28 08:43:17.000000000 +0200
@@ -2371,7 +2371,7 @@ bind_int_variable (lhs, rhs)
#endif
v = bind_variable (lhs, rhs, 0);
- if (isint)
+ if (isint && v)
VSETATTR (v, att_integer);
return (v);

View File

@ -6,7 +6,7 @@
Version: %{baseversion}%{patchleveltag} Version: %{baseversion}%{patchleveltag}
Name: bash Name: bash
Summary: The GNU Bourne Again shell Summary: The GNU Bourne Again shell
Release: 2%{?dist} Release: 3%{?dist}
Group: System Environment/Shells Group: System Environment/Shells
License: GPLv3+ License: GPLv3+
Url: http://www.gnu.org/software/bash Url: http://www.gnu.org/software/bash
@ -55,6 +55,10 @@ Patch123: bash-4.0-nobits.patch
# Do the same CFLAGS in generated Makefile in examples # Do the same CFLAGS in generated Makefile in examples
Patch124: bash-4.1-examples.patch Patch124: bash-4.1-examples.patch
# 618289, don't segfault when trying to bind int variable to array
# with bad array subsrcipt
Patch125: bash-4.1-bind_int_variable.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n) BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: texinfo bison BuildRequires: texinfo bison
@ -112,6 +116,7 @@ This package contains documentation files for %{name}.
%patch118 -p1 -b .tty_tests %patch118 -p1 -b .tty_tests
%patch123 -p1 -b .nobits %patch123 -p1 -b .nobits
%patch124 -p1 -b .examples %patch124 -p1 -b .examples
%patch125 -p1 -b .bind_int_variable
echo %{version} > _distribution echo %{version} > _distribution
echo %{release} > _patchlevel echo %{release} > _patchlevel
@ -287,6 +292,11 @@ fi
#%doc doc/*.ps doc/*.0 doc/*.html doc/article.txt #%doc doc/*.ps doc/*.0 doc/*.html doc/article.txt
%changelog %changelog
* Wed Dec 01 2010 Roman Rakus <rrakus@redhat.com> - 4.1.9-3
- don't segfault when trying to bind int variable to array
with bad array subsrcipt
Resolves: #618289
* Fri Oct 15 2010 Ville Skyttä <ville.skytta@iki.fi> - 4.1.9-2 * Fri Oct 15 2010 Ville Skyttä <ville.skytta@iki.fi> - 4.1.9-2
- Move doc dir ownership to main package. - Move doc dir ownership to main package.
- Preserve doc timestamps. - Preserve doc timestamps.