summaryrefslogtreecommitdiffstats
path: root/generic/tclClock.c
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2007-08-25 17:12:18 (GMT)
committerKevin B Kenny <kennykb@acm.org>2007-08-25 17:12:18 (GMT)
commitedebc51cd082804c286a3e8a8cfbb7f4f51ca543 (patch)
treefbb90008944a953f2709c6ee675369ef1b6f01ef /generic/tclClock.c
parenta8bfcfc6e80c0eaedcdf8e6c9c9088fea32e4ffa (diff)
downloadtcl-edebc51cd082804c286a3e8a8cfbb7f4f51ca543.zip
tcl-edebc51cd082804c286a3e8a8cfbb7f4f51ca543.tar.gz
tcl-edebc51cd082804c286a3e8a8cfbb7f4f51ca543.tar.bz2
* generic/tclClock.c (FormatClock): Claimed additional space for
the %c format code to avoid a buffer overrun when formatting (for example) a Friday in February in the Portuguese locale. [Bug 1751117]
Diffstat (limited to 'generic/tclClock.c')
-rw-r--r--generic/tclClock.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/generic/tclClock.c b/generic/tclClock.c
index a939fb2..ace6809 100644
--- a/generic/tclClock.c
+++ b/generic/tclClock.c
@@ -11,7 +11,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.20.2.3 2007/04/21 22:42:49 kennykb Exp $
+ * RCS: @(#) $Id: tclClock.c,v 1.20.2.4 2007/08/25 17:12:20 kennykb Exp $
*/
#include "tcl.h"
@@ -328,6 +328,9 @@ FormatClock(interp, clockVal, useGMT, format)
for (bufSize = 1, p = format; *p != '\0'; p++) {
if (*p == '%') {
bufSize += 40;
+ if (p[1] == 'c') {
+ bufSize += 226;
+ }
} else {
bufSize++;
}