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.1-stable, updated. gawk-4.1.0-655


From: Arnold Robbins
Subject: [gawk-diffs] [SCM] gawk branch, gawk-4.1-stable, updated. gawk-4.1.0-655-g3de7142
Date: Tue, 14 Apr 2015 11:15:19 +0000

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.1-stable has been updated
       via  3de71423b3a39be0b9536413321c953cbf99b119 (commit)
      from  f156eb53457a9e4e34c1b96f9e54eb130dffd8a3 (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=3de71423b3a39be0b9536413321c953cbf99b119

commit 3de71423b3a39be0b9536413321c953cbf99b119
Author: Arnold D. Robbins <address@hidden>
Date:   Tue Apr 14 14:00:22 2015 +0300

    Improve negative time value checking for strftime.

diff --git a/ChangeLog b/ChangeLog
index 335ab6e..f7b45d9 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+2015-04-14         Arnold D. Robbins     <address@hidden>
+
+       * builtin.c (do_strftime): Restore checking for negative result and
+       add check that time_t is > 0 --- means we're assigning a negative value
+       to an unsigned time_t. Thanks again to Glaudiston Gomes da Silva
+       <address@hidden>.
+
 2015-04-13         Arnold D. Robbins     <address@hidden>
 
        * regcomp.c (analyze): Prevent malloc(0).
diff --git a/builtin.c b/builtin.c
index 7aeccd5..a7853d7 100644
--- a/builtin.c
+++ b/builtin.c
@@ -1913,17 +1913,13 @@ do_strftime(int nargs)
                                lintwarn(_("strftime: received non-numeric 
second argument"));
                        (void) force_number(t2);
                        clock_val = get_number_si(t2);
+                       fclock = (time_t) clock_val;
                        /*
-                        * 4/2015: This used to be here:
-                        *
-                        * if (clock_val < 0)
-                        *      fatal(_("strftime: second argument less than 0 
or too big for time_t"));
-                        *
-                        * It is now disabled since some systems have strftime 
that works
-                        * on times before the epoch.  No arbritrary limits 
comes into
-                        * play at this point.
+                        * 4/2015: Protect against negative value being assigned
+                        * to unsigned time_t.
                         */
-                       fclock = (time_t) clock_val;
+                       if (clock_val < 0 && fclock > 0)
+                               fatal(_("strftime: second argument less than 0 
or too big for time_t"));
                        DEREF(t2);
                }
 

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

Summary of changes:
 ChangeLog |    7 +++++++
 builtin.c |   14 +++++---------
 2 files changed, 12 insertions(+), 9 deletions(-)


hooks/post-receive
-- 
gawk



reply via email to

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