diff options
author | kennykb <kennykb@noemail.net> | 2008-02-27 02:08:22 (GMT) |
---|---|---|
committer | kennykb <kennykb@noemail.net> | 2008-02-27 02:08:22 (GMT) |
commit | d5939183f2768415e4a207c306591f79960fbfa5 (patch) | |
tree | 6b2e7fe61cec45eb7e135a8d0a03c2ed79792b72 /generic/tclClock.c | |
parent | 7a32b33946d8e5a3669194fcdd5fca42e52a8cef (diff) | |
download | tcl-d5939183f2768415e4a207c306591f79960fbfa5.zip tcl-d5939183f2768415e4a207c306591f79960fbfa5.tar.gz tcl-d5939183f2768415e4a207c306591f79960fbfa5.tar.bz2 |
* doc/clock.n: Corrected minor indentation gaffe in the
penultimate paragraph. [Bug 1898025]
* generic/tclClock.c (ParseClockFormatArgs): Changed to check that
the clock value is in the range of a 64-bit integer. [Bug 1862555]
* library/clock.tcl (::tcl::clock::format, ::tcl::clock::scan,
::tcl::clock::add, ::tcl::clock::LocalizeFormat): Fixed bugs
in caching of localized strings that caused weird results when
localized date/time formats were used. [Bug 1902423]
* tests/clock.test (clock-61.*, clock-62.1): Regression tests
for [Bug 1862555] and [Bug 1902423].
FossilOrigin-Name: bc94636f47caf10398b845f283791a016db29d60
Diffstat (limited to 'generic/tclClock.c')
-rw-r--r-- | generic/tclClock.c | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/generic/tclClock.c b/generic/tclClock.c index af88334..12c2e64 100644 --- a/generic/tclClock.c +++ b/generic/tclClock.c @@ -12,7 +12,7 @@ * See the file "license.terms" for information on usage and redistribution of * this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclClock.c,v 1.65 2008/02/27 00:12:25 das Exp $ + * RCS: @(#) $Id: tclClock.c,v 1.66 2008/02/27 02:08:27 kennykb Exp $ */ #include "tclInt.h" @@ -65,6 +65,7 @@ typedef enum ClockLiteral { LIT_CE, LIT_DAYOFMONTH, LIT_DAYOFWEEK, LIT_DAYOFYEAR, LIT_ERA, LIT_GMT, LIT_GREGORIAN, + LIT_INTEGER_VALUE_TOO_LARGE, LIT_ISO8601WEEK, LIT_ISO8601YEAR, LIT_JULIANDAY, LIT_LOCALSECONDS, LIT_MONTH, @@ -80,6 +81,7 @@ static const char *const literals[] = { "CE", "dayOfMonth", "dayOfWeek", "dayOfYear", "era", ":GMT", "gregorian", + "integer value too large to represent", "iso8601Week", "iso8601Year", "julianDay", "localSeconds", "month", @@ -417,6 +419,16 @@ ClockGetdatefieldsObjCmd( return TCL_ERROR; } + /* + * fields.seconds could be an unsigned number that overflowed. Make + * sure that it isn't. + */ + + if (objv[1]->typePtr == &tclBignumType) { + Tcl_SetObjResult(interp, literals[LIT_INTEGER_VALUE_TOO_LARGE]); + return TCL_ERROR; + } + /* * Convert UTC time to local. */ |