gawk-diffs
[Top][All Lists]
Advanced

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

[gawk-diffs] [SCM] gawk branch, feature/fixtype, updated. gawk-4.1.0-186


From: Andrew J. Schorr
Subject: [gawk-diffs] [SCM] gawk branch, feature/fixtype, updated. gawk-4.1.0-1863-ge4863f1
Date: Mon, 27 Jun 2016 23:49:18 +0000 (UTC)

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, feature/fixtype has been updated
       via  e4863f1b6341cbcc4132a8161e000e81092b4d65 (commit)
      from  a7b4445ceb1d355911a8a367b8db79b225094c43 (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=e4863f1b6341cbcc4132a8161e000e81092b4d65

commit e4863f1b6341cbcc4132a8161e000e81092b4d65
Author: Andrew J. Schorr <address@hidden>
Date:   Mon Jun 27 19:48:34 2016 -0400

    Protect against an improper call to free in r_format_val.

diff --git a/ChangeLog b/ChangeLog
index 8c712c4..3f3541b 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2016-06-27         Andrew J. Schorr     <address@hidden>
+
+       * node.c (r_format_val): Do not free stptr unless STRCUR is set.
+       This is safer than testing for non-NULL stptr, since, for example,
+       pp_number copies a node and calls r_format_val, but does not bother
+       to set stptr to NULL beforehand.
+
 2016-06-26         Andrew J. Schorr     <address@hidden>
 
        * node.c (r_force_number): When checking for trailing spaces, protect
diff --git a/node.c b/node.c
index 58b5456..2c099bd 100644
--- a/node.c
+++ b/node.c
@@ -272,7 +272,7 @@ r_format_val(const char *format, int index, NODE *s)
                        s->flags |= STRING;
                }
        }
-       if (s->stptr != NULL)
+       if ((s->flags & STRCUR) != 0)
                efree(s->stptr);
        emalloc(s->stptr, char *, s->stlen + 1, "format_val");
        memcpy(s->stptr, sp, s->stlen + 1);

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

Summary of changes:
 ChangeLog |    7 +++++++
 node.c    |    2 +-
 2 files changed, 8 insertions(+), 1 deletion(-)


hooks/post-receive
-- 
gawk



reply via email to

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