diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2014-05-09 11:39:05 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2014-05-09 11:39:05 +0300 |
commit | 123402fa15ec56d510ddd4cba16a5aea88e18023 (patch) | |
tree | bed74a5ab52d9e53935c220f87f7c54a108f9637 | |
parent | 03edc59397a4924b29852107198c4f345c986e80 (diff) | |
download | egawk-123402fa15ec56d510ddd4cba16a5aea88e18023.tar.gz egawk-123402fa15ec56d510ddd4cba16a5aea88e18023.tar.bz2 egawk-123402fa15ec56d510ddd4cba16a5aea88e18023.zip |
Fix double free error in do_eval.
-rw-r--r-- | ChangeLog | 8 | ||||
-rw-r--r-- | debug.c | 12 |
2 files changed, 18 insertions, 2 deletions
@@ -1,3 +1,11 @@ +2014-05-09 Arnold D. Robbins <arnold@skeeve.com> + + * debug.c (do_eval): Don't free `f' which points into the context + that was previously freed. Bug reported by Jan Chaloupka + <jchaloup@redhat.com>. Apparently introduced with move to + SYMTAB and FUNCTAB, but only showed up on Fedora 20 and Ubuntu 14.04, + which have a newer glibc. + 2014-05-04 Arnold D. Robbins <arnold@skeeve.com> * debug.c (debug_prog): Change check for GAWK_RESTART so that it @@ -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" */ + + /* + * May 2014: + * Don't do this. f points into the context we just released. + * Only showed up on Fedora 20 / Ubuntu 14.04. + * + * if (ret_val != NULL) + * destroy_symbol(f); // destroy "@eval" + */ + return false; } |