diff options
-rw-r--r-- | ChangeLog | 6 | ||||
-rw-r--r-- | builtin.c | 2 |
2 files changed, 8 insertions, 0 deletions
@@ -1,3 +1,9 @@ +2011-10-18 Arnold D. Robbins <arnold@skeeve.com> + + * builtin.c (do_strftime): Add check for negative / overflowed + time_t value with fatal error. Thanks to Hermann Peifer + <peifer@gmx.eu> for the bug report. + 2011-10-10 Arnold D. Robbins <arnold@skeeve.com> * builtin.c (do_sub): Init textlen to zero to avoid "may be @@ -1673,6 +1673,8 @@ do_strftime(int nargs) if (do_lint && (t2->flags & (NUMCUR|NUMBER)) == 0) lintwarn(_("strftime: received non-numeric second argument")); fclock = (time_t) force_number(t2); + if (fclock < 0) + fatal(_("strftime: second argument less than 0 or too big for time_t")); DEREF(t2); } |