eval fixed, caused invalid free

This commit is contained in:
jchaloup 2014-05-13 09:59:13 +02:00
parent e3282563da
commit 586e5eae48
2 changed files with 42 additions and 1 deletions

View File

@ -0,0 +1,35 @@
From 1ce114185c83a5c711a791da42e46dad77b4fa34 Mon Sep 17 00:00:00 2001
From: jchaloup <jchaloup@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

View File

@ -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@redhat.com> - 4.1.1-2
- resolves: #1089073
eval invalid free
* Mon Apr 21 2014 Ondrej Vasik <ovasik@redhat.com> - 4.1.1-1
- Update to upstream 4.1.1 (#1087242)