Skip to content
Tcl Source Code Artifact [c22669188a]
Login

Artifact [c22669188a]

Artifact c22669188addc70faa14110e4146222f883370f9425279ebc40c66e382b8bfcb:

Ticket change [c22669188a] - New ticket [05ff16e799ef5d6d|05ff16e799] <i>signed integer overflow in ExtendStringRepWithUnicode()</i>. by chrstphrchvz on 2022-04-07 18:58:01.
D 2022-04-07T18:58:01.586
J assignee nobody
J closer nobody
J cmimetype text/x-fossil-wiki
J comment Example\sscript\s(assumes\syour\sTcl\salready\shas\sthe\sfix\sfor\s[0e8fd6c6d5]):\r\n\r\n<blockquote>\r\n<pre>\r\nset\sz\s&#91;string\srepeat\s"\\u0000"\s1073741820&#93;\r\nputs\sstderr\s&#91;::tcl::unsupported::representation\s$z&#93;<br\s/>\r\n#\screate\sstring\sobj\swith\slongest\spossible\sunicode\srep\sand\sno\sstring\srep\r\nset\szz\s&#91;string\sreplace\s$z\s0\s1\s$z&#93;\r\nputs\sstderr\s&#91;::tcl::unsupported::representation\s$zz&#93;<br\s/>\r\n#\sforce\sgenerating\sstring\srep\s(should\sabort\sdue\sto\sexceeding\smax\ssize\sfor\sa\sTcl\svalue)\r\nset\sZZ\s&#91;string\stoupper\s$zz&#93;\r\nputs\sstderr\s&#91;::tcl::unsupported::representation\s$ZZ&#93;\r\n</pre>\r\n</blockquote>\r\n\r\nOutput\scontaining\sUBSan\s<tt>-fsanitize=signed-integer-overflow</tt>\serror\s(which\sthe\sattached\spatch\sprevents):\r\n\r\n<blockquote>\r\n<pre>\r\nvalue\sis\sa\spure\sstring\swith\sa\srefcount\sof\s2,\sobject\spointer\sat\s0x604000041490,\sstring\srepresentation\s"..."\r\nvalue\sis\sa\sstring\swith\sa\srefcount\sof\s2,\sobject\spointer\sat\s0x604000041c10,\sinternal\srepresentation\s0x316793800:0xbebebebebebebebe,\sno\sstring\srepresentation\r\n<span\sstyle="font-weight:bold">tcl/generic/tclStringObj.c:3344:7:\s<span\sstyle="color:firebrick">runtime\serror:</span>\ssigned\sinteger\soverflow:\s2147483646\s+\s2\scannot\sbe\srepresented\sin\stype\s'int'</span>\r\nmax\ssize\sfor\sa\sTcl\svalue\s(2147483647\sbytes)\sexceeded\r\n</pre>\r\n(tclsh\saborted)\r\n</blockquote>
J foundin core-8-6-branch
J is_private 0
J login chrstphrchvz
J priority 5\sMedium
J resolution None
J severity Minor
J status Open
J submitter chrstphrchvz
J subsystem 10.\sObjects
J title signed\sinteger\soverflow\sin\sExtendStringRepWithUnicode()
J type Patch
K 05ff16e799ef5d6d15ad1330425f243e5c49d13f
U chrstphrchvz
Z b3744c8dd42f7a16cb1d023672ce4a53