summaryrefslogtreecommitdiffstats
path: root/unix/tclUnixTime.c
diff options
context:
space:
mode:
authorjan.nijtmans <nijtmans@users.sourceforge.net>2022-02-21 16:18:10 (GMT)
committerjan.nijtmans <nijtmans@users.sourceforge.net>2022-02-21 16:18:10 (GMT)
commitc736c693049e659603b5cc2efb22092d921cc250 (patch)
tree040cd8807107ecb6756f0fafd333fbffe946f6c5 /unix/tclUnixTime.c
parentff710528dbb61e071fac856e1923f8a59c689a2a (diff)
downloadtcl-c736c693049e659603b5cc2efb22092d921cc250.zip
tcl-c736c693049e659603b5cc2efb22092d921cc250.tar.gz
tcl-c736c693049e659603b5cc2efb22092d921cc250.tar.bz2
Fix [fb4a0a6675]: signed integer overflow in TclpGetClicks()
Diffstat (limited to 'unix/tclUnixTime.c')
-rw-r--r--unix/tclUnixTime.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/unix/tclUnixTime.c b/unix/tclUnixTime.c
index 0fc87ea..3694ba2 100644
--- a/unix/tclUnixTime.c
+++ b/unix/tclUnixTime.c
@@ -136,7 +136,7 @@ TclpGetClicks(void)
Tcl_Time time;
tclGetTimeProcPtr(&time, tclTimeClientData);
- now = time.sec*1000000 + time.usec;
+ now = ((unsigned long)(time.sec)*1000000UL) + (unsigned long)(time.usec);
} else {
/*
* A semi-NativeGetTime, specialized to clicks.
@@ -149,7 +149,7 @@ TclpGetClicks(void)
Tcl_Time time;
tclGetTimeProcPtr(&time, tclTimeClientData);
- now = time.sec*1000000 + time.usec;
+ now = ((unsigned long)(time.sec)*1000000UL) + (unsigned long)(time.usec);
#endif
return now;