Artifacts Associated With Ticket 32337edbd60e90c1
Ticket change [a9d8769f3d] (rid 168813) by dgp on 2019-02-01 16:31:29:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/plain"
- comment initialized to:
On the core-8-branch, the internal routine TclStackAlloc() takes a second argument of type int to specify the number of bytes to allocate. Recently (for example, https://core.tcl-lang.org/tcl/info/a6cbc60ca29e236b ) callers of TclStackAlloc have had the expressions of their second argument values modified. It's not clear to me that the new expressions or the old expressions take care to avoid integer overflow.
- foundin initialized to: "8.7"
- is_private initialized to: "0"
- login: "dgp"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "dgp"
- subsystem initialized to: "69. Other"
- title initialized to: "TclStackAlloc argument type"
- type initialized to: "Bug"
Ticket change [3bb3c35049] (rid 168814) by dgp on 2019-02-01 16:31:41:
- assignee changed to: "jan.nijtmans"
- login: "dgp"
- mimetype: "text/plain"
Ticket change [bab17a2ae2] (rid 168888) by jan.nijtmans on 2019-02-02 18:10:45:
- closedate changed to: "2458517.2574676"
- closer changed to: "jan.nijtmans"
- icomment:
The only modification I see in the TclStackAlloc() call is removal of the (unsigned) cast. This type cast is useless: since TclStackAlloc() has an int argument, overflow is always possible, it was and still is. Since TclStackAlloc() is meant to allocate a small number of 'things', and general the call does something like TclStackAlloc(numThings * sizeof(thing)), I don't think much can be done without changing the argument of TclStackAlloc() to something bigger as int. That's already done in Tcl 9.0. So, I would suggest to leave it as-is for the Tcl-8 line, it's not worth the trouble. as long as numThings is small compared to the total memory, it will continue to work fine. For Tcl-9 it's fixed already, since TclStackAlloc() got a size_t argument. For 32-bit platforms it can handle double the sizes as it could in Tcl-8. For 64-bit platforms, there's practically no limit any more.
- login: "jan.nijtmans"
- mimetype: "text/plain"
- resolution changed to: "Works For Me"
- status changed to: "Closed"