Overview
| Artifact ID: | a4b175c4b67d96dc51ef222f005bef783160a44c6b50be620852bf65b790e9c1 |
|---|---|
| Ticket: | e32a44e2e49e5fe3a21162db2b2dd915ba8589d5
Tcl_Merge(): signed integer overflow |
| User & Date: | chrstphrchvz on 2022-10-02 11:26:50 |
Changes
- assignee changed to: "nobody"
- closer changed to: "nobody"
- cmimetype changed to: "text/x-fossil-wiki"
- comment changed to:
Example script (not much usage of <tt>Tcl_Merge()</tt> in core Tcl): <blockquote><pre> set 1k_spaces [string repeat { } [::tcl::mathop::<< 1 10]] set 1M_spaces [string repeat $1k_spaces [::tcl::mathop::<< 1 10]] set 1G_spaces [string repeat $1M_spaces [::tcl::mathop::<< 1 10]] testpanic $1G_spaces $1G_spaces </pre></blockquote> Output containing UBSan error, which the attached patch avoids: <blockquote><pre> $ ./tcltest script.tcl </pre> (some time passes) <pre> <span style="font-weight:bold">tcl/generic/tclUtil.c:1596:14: <span style="color:firebrick">runtime error:</span> signed integer overflow: 1073741826 + 1073741826 cannot be represented in type 'int'</span> max size for a Tcl value (2147483647 bytes) exceeded </pre> (tcltest aborts, though before <tt>TestpanicCmd()</tt> can directly call <tt>Tcl_Panic()</tt>.) </blockquote> - foundin changed to: "core-8-6-branch"
- is_private changed to: "0"
- login: "chrstphrchvz"
- priority changed to: "5 Medium"
- resolution changed to: "None"
- severity changed to: "Minor"
- status changed to: "Open"
- submitter changed to: "chrstphrchvz"
- subsystem changed to: "14. List Object"
- title changed to: "Tcl_Merge(): signed integer overflow"
- type changed to: "Patch"