[bash] Fix the infinite loop with invalid wide char. #684293
Roman Rakus
rrakus at fedoraproject.org
Tue Mar 15 11:22:53 UTC 2011
commit bd46d070ddc24a3cb5c5abe8e133d153b26a22ab
Author: Roman Rakus <rrakus at redhat.com>
Date: Tue Mar 15 12:22:29 2011 +0100
Fix the infinite loop with invalid wide char. #684293
Signed-off-by: Roman Rakus <rrakus at redhat.com>
bash-4.2-xdupmbstowcs2-patch | 19 +++++++++++++++++++
bash.spec | 9 ++++++++-
2 files changed, 27 insertions(+), 1 deletions(-)
---
diff --git a/bash-4.2-xdupmbstowcs2-patch b/bash-4.2-xdupmbstowcs2-patch
new file mode 100644
index 0000000..a16e477
--- /dev/null
+++ b/bash-4.2-xdupmbstowcs2-patch
@@ -0,0 +1,19 @@
+*** ../bash-4.2-patched/lib/glob/xmbsrtowcs.c 2010-05-30 18:36:27.000000000 -0400
+--- lib/glob/xmbsrtowcs.c 2011-03-14 14:22:11.000000000 -0400
+***************
+*** 174,180 ****
+ wcslength = mbsnrtowcs(NULL, &tmp_p, nms, 0, &tmp_state);
+
+ /* Conversion failed. */
+! if (wcslength == (size_t)-1)
+ {
+ free (wsbuf);
+ *destp = NULL;
+--- 174,180 ----
+ wcslength = mbsnrtowcs(NULL, &tmp_p, nms, 0, &tmp_state);
+
+ /* Conversion failed. */
+! if (wcslength == 0 || wcslength == (size_t)-1)
+ {
+ free (wsbuf);
+ *destp = NULL;
diff --git a/bash.spec b/bash.spec
index 6ee23bc..55cc850 100644
--- a/bash.spec
+++ b/bash.spec
@@ -6,7 +6,7 @@
Version: %{baseversion}%{patchleveltag}
Name: bash
Summary: The GNU Bourne Again shell
-Release: 2%{?dist}
+Release: 3%{?dist}
Group: System Environment/Shells
License: GPLv3+
Url: http://www.gnu.org/software/bash
@@ -62,6 +62,9 @@ Patch120: bash-4.2-rc2-logout.patch
# Static analyzis shows some issues in bash-2.05a-interpreter.patch
Patch121: bash-4.2-coverity.patch
+# 684293, Fix the infinite loop with invalid wide char
+Patch122: bash-4.2-xdupmbstowcs2-patch
+
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
BuildRequires: texinfo bison
@@ -119,6 +122,7 @@ This package contains documentation files for %{name}.
%patch119 -p1 -b .broken_pipe
%patch120 -p1 -b .logout
%patch121 -p1 -b .coverity
+%patch122 -p0 -b .xdupmbstowcs2
echo %{version} > _distribution
echo %{release} > _patchlevel
@@ -306,6 +310,9 @@ end
#%doc doc/*.ps doc/*.0 doc/*.html doc/article.txt
%changelog
+* Tue Mar 15 2011 Roman Rakus <rrakus at redhat.com> - 4.2.7-3
+- #684293, fix the infinite loop with invalid wide char
+
* Mon Mar 14 2011 Roman Rakus <rrakus at redhat.com> - 4.2.7-2
- Use lua script in postun
More information about the scm-commits
mailing list