Overview
| Artifact ID: | c4773d1c0f521feaff175f46eed390d35e30fbd8debd1dee8e9bcde160ea593b |
|---|---|
| Ticket: | b6afa337376342ff91953f200db89ff4ff4f5fe6
signed integer overflow in TclInitStringRep() macro |
| User & Date: | jan.nijtmans on 2022-03-08 15:18:30 |
Changes
- assignee changed to: "jan.nijtmans"
- closedate changed to: "2459647.1378531"
- closer changed to: "jan.nijtmans"
- comment changed to:
Example script and corresponding output with UBSan error (<tt>-fsanitize=signed-integer-overflow</tt>, excludes any previously reported errors): <blockquote><pre> proc p {} { set a [string repeat [string repeat a 1023] 1049601] set a2 [string cat a $a $a] return [string toupper $a2] } set x [p] </pre> <pre> <span style="font-weight:bold">tcl/generic/tclExecute.c:5520:6:<span style="color:firebrick"> runtime error: </span>signed integer overflow: 2147483647 + 1 cannot be represented in type 'int'</span> </pre>(tclsh eventually exited normally)</blockquote> Can be prevented with same approach used in [a03e9793d4]; see attached patch. - icomment: "Fixed [a314f4ea6233c15d|here]. Thanks!"
- login: "jan.nijtmans"
- mimetype: "text/x-fossil-wiki"
- resolution changed to: "Fixed"
- status changed to: "Closed"