From 26420780dc871d96d12f388ad5945a563d71129bb3befa9e36e944cb58729e5c Mon Sep 17 00:00:00 2001 From: "Dr. Werner Fink" Date: Mon, 12 Apr 2010 09:37:38 +0000 Subject: [PATCH] . OBS-URL: https://build.opensuse.org/package/show/Base:System/bash?expand=0&rev=34 --- bash-4.1-array.dif | 18 ++++++++++++++++++ bash.changes | 5 +++++ bash.spec | 2 ++ 3 files changed, 25 insertions(+) create mode 100644 bash-4.1-array.dif diff --git a/bash-4.1-array.dif b/bash-4.1-array.dif new file mode 100644 index 0000000..82f3578 --- /dev/null +++ b/bash-4.1-array.dif @@ -0,0 +1,18 @@ +Andreas Schwab writes: + +> $ declare -A a=b; unset a +> *** glibc detected *** /bin/bash: free(): invalid pointer: 0x10091644 *** + +And the obvious patch: + +--- builtins/declare.def ++++ builtins/declare.def 2010-04-09 17:20:51.000000000 +0000 +@@ -512,7 +512,7 @@ declare_internal (list, local_var) + { + /* let bind_{array,assoc}_variable take care of this. */ + if (assoc_p (var)) +- bind_assoc_variable (var, name, "0", value, aflags); ++ bind_assoc_variable (var, name, savestring ("0"), value, aflags); + else + bind_array_variable (name, 0, value, aflags); + } diff --git a/bash.changes b/bash.changes index d591892..0f2e225 100644 --- a/bash.changes +++ b/bash.changes @@ -1,3 +1,8 @@ +------------------------------------------------------------------- +Mon Apr 12 11:36:30 CEST 2010 - werner@suse.de + +- Add fix for memory double free in array handling + ------------------------------------------------------------------- Tue Apr 6 15:27:24 CEST 2010 - werner@suse.de diff --git a/bash.spec b/bash.spec index 5a0e2c9..b15d41e 100644 --- a/bash.spec +++ b/bash.spec @@ -65,6 +65,7 @@ Patch30: readline-6.1-destdir.patch Patch40: bash-4.1-bash.bashrc.dif Patch41: bash-4.1-intr.dif Patch42: bash-4.1-non_void.patch +Patch43: bash-4.1-array.dif BuildRoot: %{_tmppath}/%{name}-%{version}-build %global _sysconfdir /etc %global _incdir %{_includedir} @@ -310,6 +311,7 @@ unset p %patch40 -p0 -b .bashrc %patch41 -p0 -b .intr %patch42 -p0 -b .non_void +%patch43 -p0 -b .array %patch0 -p0 cd ../readline-%{rl_vers} for p in ../readline-%{rl_vers}-patches/*; do