Skip to content
Tcl Source Code Artifact [744a9173de]
Login

Artifact [744a9173de]

Artifact 744a9173deb23b70c35996b8f55f34394064e9134c7cb77453b03658f12891ed:

Ticket change [744a9173de] - Ticket [fb368527aeed240f|fb368527ae] <i>String truncation in encoding &gt; 2GB length</i> status still Open with 3 other changes by apnadkarni on 2023-02-26 16:08:04.
D 2023-02-26T16:08:04.996
J icomment One\smore\sremark\son\sTcl_UtfToExternal()\sand\sTcl_ExternalToUtf().\sIt\sappears\syou\schanged\sthe\sparameter\stype\sdstLen\sand\ssrcLen\son\sthose\sfunctions\sfrom\sint\sto\sTcl_Size.\s\r\n\r\nI\sdon't\sthink\sthat\sis\sa\sgood\sidea.\sAside\sfrom\sthe\sfact\sthat\sit\sis\snot\sTIP'ed\s(I'm\snot\ssure\sI\scare\smuch\sabout\sthat\saspect,\sit\scan\sbe\scorrected),\sI\sthink\sfunctions\sshould\sclearly\sdeal\swith\seither\s32-bit\slengths\sor\s64\sbit\slengths\sand\sthis\sshould\sbe\sapparent\sfrom\stheir\ssignatures\s(parameter\stypes).\sThose\stwo\sfunctions\shave\sinput\sas\sTcl_Size\sand\soutput\s(via\spointers)\sas\sints.\sThis\sleads\sto\sconfusion\sas\sto\soperation\swhen\sinputs\sexceed\s31-bit\slengths.\s\r\n\r\nAlso,\sas\san\saside,\salthough\sthose\sfunctions\sare\snot\swidely\sused\swithin\sTcl\score,\sthey\sare\spublic\sand\sused\sby\sextensions\sas\sthe\sDstring\svariants\sdo\snot\sallow\sfor\sstreaming\soperations.\r\n\r\nI'm\salso\sdiving\sinto\sthe\scrash\son\sthe\sread\sside\s(which\sis\sa\sthornier\sissue\swith\smultiple\splaces\swhere\sthis\ssize_t->int\struncation\sis\shappening).\sAnother\sreason\sto\shave\sa\sclear\sdemarcation\sbetween\sthe\s64-bit\scapable\sand\s32-bit\scapable\sfunctions.\sIf\sthe\sformer\sneed\sto\smake\suse\sof\sthe\slatter,\sthey\sneed\sto\scall\sthem\sin\sa\sloop\swith\sappropriate\schecks\son\sthe\sparameters\s(as\sdone\sin\sthis\sbranch)\r\n\r\nI\ssuggest\sthey\sbe\skept\sas\s32-bit\slength\sfunctions,\sat\sleast\sfor\snow,\ssince\sthe\sunderlying\sencoders\sdeal\swith\s32-bit\slengths.\sI'll\splan\son\smaking\sthat\schange\sback.\r\n\r\n/Ashok
J login apnadkarni
J mimetype text/x-markdown
K fb368527aeed240f2b345be96119ea66e1fce6fb
U apnadkarni
Z 0594fceceaf6afe70c1dd70953839885