Artifacts Associated With Ticket 112e7aa36d
Ticket change [9241e84ed8] (rid 198737) by chrstphrchvz on 2022-03-05 22:48:06:
- assignee initialized to: "nobody"
- closer initialized to: "nobody"
- cmimetype initialized to: "text/x-fossil-wiki"
- comment initialized to:
Calling <tt>Tcl_SetObjLength(…, INT_MAX)</tt> or <tt>Tcl_AttemptSetObjLength(…, INT_MAX)</tt> leads to signed integer overflow. The attached patch avoids this. Example UBSan error: <pre> <span style="font-weight:bold">tcl/generic/tclStringObj.c:961:27:<span style="color:red"> runtime error: </span>signed integer overflow: 2147483647 + 1 cannot be represented in type 'int'</span> </pre> Example test case to add to stringObj.test (likely not desirable for Tcl to adopt—will panic on systems with insufficient memory): <pre> test stringObj-4.99 {Tcl_SetObjLength procedure, string lengthened to INT_MAX} testobj { testobj freeallvars teststringobj set 1 abcdef teststringobj setlength 1 [expr 2**31-1] list [teststringobj length 1] } [list [expr 2**31-1]] </pre> - foundin initialized to: "core-8-6-branch"
- is_private initialized to: "0"
- login: "chrstphrchvz"
- priority initialized to: "5 Medium"
- resolution initialized to: "None"
- severity initialized to: "Minor"
- status initialized to: "Open"
- submitter initialized to: "chrstphrchvz"
- subsystem initialized to: "10. Objects"
- title initialized to:
signed integer overflow in Tcl_SetObjLength(), Tcl_AttemptSetObjLength()
- type initialized to: "Patch"
Add attachment "112e7aa36d.diff" [a01e9b22d1] (rid 198738) by chrstphrchvz on 2022-03-05 22:48:47.
Ticket change [89c227a3bd] (rid 198772) by jan.nijtmans on 2022-03-06 16:00:59:
- assignee changed to: "jan.nijtmans"
- closedate changed to: "2459645.16735866"
- closer changed to: "jan.nijtmans"
- icomment:
Fixed [2699f682ae|here] Thanks for the report and the patch!
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Closed"