[gawk] eval fixed, caused invalid free

Jan Chaloupka jchaloup at fedoraproject.org
Tue May 13 07:59:48 UTC 2014


commit 586e5eae48d8f639eb3a59f929b61d77bdd96a24
Author: jchaloup <jchaloup at redhat.com>
Date:   Tue May 13 09:59:13 2014 +0200

    eval fixed, caused invalid free

 gawk-4.1.1-eval_invalid_free.patch |   35 +++++++++++++++++++++++++++++++++++
 gawk.spec                          |    8 +++++++-
 2 files changed, 42 insertions(+), 1 deletions(-)
---
diff --git a/gawk-4.1.1-eval_invalid_free.patch b/gawk-4.1.1-eval_invalid_free.patch
new file mode 100644
index 0000000..6e26c80
--- /dev/null
+++ b/gawk-4.1.1-eval_invalid_free.patch
@@ -0,0 +1,35 @@
+From 1ce114185c83a5c711a791da42e46dad77b4fa34 Mon Sep 17 00:00:00 2001
+From: jchaloup <jchaloup at redhat.com>
+Date: Tue, 13 May 2014 09:28:46 +0200
+Subject: [PATCH] eval invalid free
+
+---
+ debug.c | 12 ++++++++++--
+ 1 file changed, 10 insertions(+), 2 deletions(-)
+
+diff --git a/debug.c b/debug.c
+index b55f357..0b6e992 100644
+--- a/debug.c
++++ b/debug.c
+@@ -5565,8 +5565,16 @@ do_eval(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
+ 
+ 	pop_context();	/* switch to prev context */
+ 	free_context(ctxt, (ret_val != NULL));   /* free all instructions and optionally symbols */
+-	if (ret_val != NULL)
+-		destroy_symbol(f);	/* destroy "@eval" */
++	if (ret_val != NULL) {
++		/*
++                * Remove @eval from FUNCTAB, so that above code
++                * will work the next time around.
++                */
++               NODE *s = make_string("@eval", 5);
++
++               (void) assoc_remove(func_table, s);
++               unref(s);
++        }
+ 	return false;
+ }
+ 
+-- 
+1.9.0
+
diff --git a/gawk.spec b/gawk.spec
index a1eceac..e7eda88 100644
--- a/gawk.spec
+++ b/gawk.spec
@@ -1,7 +1,7 @@
 Summary: The GNU version of the awk text processing utility
 Name: gawk
 Version: 4.1.1
-Release: 1%{?dist}
+Release: 2%{?dist}
 # Most of source files are licensed under GPLv3+,
 # several files are GPL or LGPLv2.1+ licensed,
 # gettext.h is LGPL and random.c is BSD licensed
@@ -10,6 +10,7 @@ Group: Applications/Text
 URL: http://www.gnu.org/software/gawk/gawk.html
 Source0: http://ftp.gnu.org/gnu/gawk/gawk-%{version}.tar.xz
 Patch1: gawk-4.1.1-build-baddest.patch
+Patch2: gawk-4.1.1-eval_invalid_free.patch 
 Requires(post): /sbin/install-info
 Requires(preun): /sbin/install-info
 Conflicts: filesystem < 3
@@ -28,6 +29,7 @@ considered to be a standard Linux tool for processing text.
 %prep
 %setup -q
 %patch1 -p1 -b .baddest
+%patch2 -p1 -b .eval_invalid_free
 
 %build
 %configure --with-libsigsegv-prefix=no
@@ -76,6 +78,10 @@ fi
 %{_libdir}/gawk
 
 %changelog
+* Tue May 13 2014 jchaloup <jchaloup at redhat.com> - 4.1.1-2
+- resolves: #1089073
+  eval invalid free
+
 * Mon Apr 21 2014 Ondrej Vasik <ovasik at redhat.com> - 4.1.1-1
 - Update to upstream 4.1.1 (#1087242)
 


More information about the scm-commits mailing list