gawk-diffs
[Top][All Lists]
Advanced

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

[gawk-diffs] [SCM] gawk branch, feature/stringfix, updated. gawk-4.1.0-2


From: Andrew J. Schorr
Subject: [gawk-diffs] [SCM] gawk branch, feature/stringfix, updated. gawk-4.1.0-2420-gc8bfe9c
Date: Fri, 27 Jan 2017 01:35:29 +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/stringfix has been updated
       via  c8bfe9cad177f47218999f16bea5cdbe7e3fa7d2 (commit)
      from  901fa6ebd5e5fd165f4ad57180e96bd2251d2c04 (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=c8bfe9cad177f47218999f16bea5cdbe7e3fa7d2

commit c8bfe9cad177f47218999f16bea5cdbe7e3fa7d2
Author: Andrew J. Schorr <address@hidden>
Date:   Thu Jan 26 20:35:08 2017 -0500

    Protect against string overrun when calling unsetenv.

diff --git a/ChangeLog b/ChangeLog
index a1bfc3a..68c5719 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,9 @@
 2017-01-26         Andrew J. Schorr     <address@hidden>
 
+       * str_array.c (env_remove): Terminate string before calling unsetenv.
+
+2017-01-26         Andrew J. Schorr     <address@hidden>
+
        * node.c (is_hex): Add a new argument pointing to the end of the string
        so we can check for string overrun.
        (r_force_number): Pass string end to is_hex.
diff --git a/str_array.c b/str_array.c
index d832380..c559a39 100644
--- a/str_array.c
+++ b/str_array.c
@@ -773,9 +773,14 @@ static NODE **
 env_remove(NODE *symbol, NODE *subs)
 {
        NODE **val = str_remove(symbol, subs);
+       char save;
 
-       if (val != NULL)
+       if (val != NULL) {
+               save = subs->stptr[subs->stlen];
+               subs->stptr[subs->stlen] = '\0';
                (void) unsetenv(subs->stptr);
+               subs->stptr[subs->stlen] = save;
+       }
 
        return val;
 }

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

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


hooks/post-receive
-- 
gawk



reply via email to

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