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-1862-ga7b4445
Date: Mon, 27 Jun 2016 01:10:58 +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  a7b4445ceb1d355911a8a367b8db79b225094c43 (commit)
      from  2b0495afae3d744127f3b6c18e98819feafbface (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=a7b4445ceb1d355911a8a367b8db79b225094c43

commit a7b4445ceb1d355911a8a367b8db79b225094c43
Author: Andrew J. Schorr <address@hidden>
Date:   Sun Jun 26 21:10:25 2016 -0400

    When checking for trailing spaces in numeric strings, avoid running off the 
end.

diff --git a/ChangeLog b/ChangeLog
index 0aa7812..8c712c4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,11 @@
 2016-06-26         Andrew J. Schorr     <address@hidden>
 
+       * node.c (r_force_number): When checking for trailing spaces, protect
+       against running off the end of the string.
+       * mpfr.c (force_mpnum): Ditto.
+
+2016-06-26         Andrew J. Schorr     <address@hidden>
+
        * builtin.c (do_print): There's actually no reason to test whether a
        value is a number, since the STRCUR flag and stfmt value contain all
        the necessary info, as in awk.h:force_string.
diff --git a/mpfr.c b/mpfr.c
index b15c9b0..f2c5811 100644
--- a/mpfr.c
+++ b/mpfr.c
@@ -327,7 +327,7 @@ force_mpnum(NODE *n, int do_nondec, int use_locale)
        IEEE_FMT(n->mpg_numbr, tval);
 done:
        /* trailing space is OK for NUMBER */
-       while (isspace((unsigned char) *ptr))
+       while (ptr < cpend && isspace((unsigned char) *ptr))
                ptr++;
        *cpend = save;
        if (errno == 0 && ptr == cpend)
diff --git a/node.c b/node.c
index 39c25df..58b5456 100644
--- a/node.c
+++ b/node.c
@@ -136,7 +136,7 @@ r_force_number(NODE *n)
        }
 
        /* POSIX says trailing space is OK for NUMBER */
-       while (isspace((unsigned char) *ptr))
+       while (ptr < cpend && isspace((unsigned char) *ptr))
                ptr++;
 
        if (errno == 0) {

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

Summary of changes:
 ChangeLog |    6 ++++++
 mpfr.c    |    2 +-
 node.c    |    2 +-
 3 files changed, 8 insertions(+), 2 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

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