gawk-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[gawk-diffs] [SCM] gawk branch, gawk-4.2-stable, updated. gawk-4.1.0-284


From: Andrew J. Schorr
Subject: [gawk-diffs] [SCM] gawk branch, gawk-4.2-stable, updated. gawk-4.1.0-2841-g6f3e075
Date: Sat, 25 Nov 2017 13:33:25 -0500 (EST)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "gawk".

The branch, gawk-4.2-stable has been updated
       via  6f3e075b3ad1e6cd5b3268fce65c768340b00a5b (commit)
      from  03caf83ac9d2862ca72daa5d18f2af27d68db1d4 (commit)

Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we list those
revisions in full, below.

- Log -----------------------------------------------------------------
http://git.sv.gnu.org/cgit/gawk.git/commit/?id=6f3e075b3ad1e6cd5b3268fce65c768340b00a5b

commit 6f3e075b3ad1e6cd5b3268fce65c768340b00a5b
Author: Andrew J. Schorr <address@hidden>
Date:   Sat Nov 25 13:33:00 2017 -0500

    Fix potential field corruption when $0 is set from the debugger.

diff --git a/ChangeLog b/ChangeLog
index 3ab99ab..3255d8e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+2017-11-25         Andrew J. Schorr      <address@hidden>
+
+       * debug.c (do_set_var): As in interpret.h (Op_store_field), we should
+       call the assign function before unref to give it a chance to copy
+       any non-malloced $n string values before freeing $0.
+
 2017-11-14         Andrew J. Schorr      <address@hidden>
 
        * mpfr.c (get_rnd_mode): Fix MPFR_RNDA comment.
diff --git a/debug.c b/debug.c
index 9a02266..3e76ae6 100644
--- a/debug.c
+++ b/debug.c
@@ -1299,10 +1299,11 @@ do_set_var(CMDARG *arg, int cmd ATTRIBUTE_UNUSED)
                arg = arg->next;
                val = arg->a_node;
                lhs = get_field(field_num, &assign);
-               unref(*lhs);
-               *lhs = dupnode(val);
                if (assign)
+                       /* call assign to copy fields before unref frees $0 */
                        assign();
+               unref(*lhs);
+               *lhs = dupnode(val);
                print_field(field_num);
        }
                break;

-----------------------------------------------------------------------

Summary of changes:
 ChangeLog | 6 ++++++
 debug.c   | 5 +++--
 2 files changed, 9 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

[Prev in Thread] Current Thread [Next in Thread]