Skip to content
Tcl Source Code View Ticket
Login

View Ticket

2022-02-23
14:16 • Closed ticket [fb4a0a6675]: signed integer overflow in TclpGetClicks() plus ... artifact: a467401033 user: jan.nijtmans
2022-02-21
16:18
Fix [fb4a0a6675]: signed integer overflow in TclpGetClicks() check-in: 8779e57115 user: jan.nijtmans tags: core-8-6-branch
2022-02-17
00:58 • Ticket [fb4a0a6675] signed integer overflow in TclpGetClicks() status still ... artifact: 449c4bab98 user: chrstphrchvz
00:55 • Add attachment clock-clicks.diff to ticket [fb4a0a6675242362|fb4a0a6675... artifact: b95f9b6a5f user: chrstphrchvz
00:55 • New ticket [fb4a0a6675] signed integer overflow in TclpGetClicks(). artifact: 74333d1cd2 user: chrstphrchvz

signed integer overflow in TclpGetClicks()

Closed / Fixedfb4a0a66752423622d38c070f89ad81e3b4c2bb8Created 5 years agoUpdated 5 years ago
Descriptionwiki2022-02-17 00:55:29
Except for maybe 35 minutes before and after the epoch, there is always signed integer overflow in TclpGetClicks() implementations when long is 32-bit:
% clock clicks
tcl/unix/tclUnixTime.c:152:19: runtime error: signed integer overflow: 1645057584 * 1000000 cannot be represented in type 'long int'
3505507099

The attached patch should avoid this, however I have only tested the case for Unix with gettimeofday(), and not the cases for Unix without gettimeofday() nor Windows without NativeGetMicroseconds().

Referenced by1
chrstphrchvz Ticket [fb4a0a6675]: 3 changes [History diff]2022-02-17 00:58:35
jan.nijtmanswiki2022-02-23 14:16:29

Fixed [here]

Thanks for the report and the patch!

Log in (anonymous is fine) to add a comment.