Skip to content
Tcl Source Code Artifact [7d4686cfab]
Login

Artifact [7d4686cfab]

Artifact 7d4686cfab956d6f82e9637cb4b84ede39891fff46328ff39a1a845bf7d86ba0:

Ticket change [7d4686cfab] - 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:51:09.
D 2023-02-26T16:51:09.256
J icomment Jan,\r\n\r\nThat\stclZlib.c\sexample\syou\slinked\sis\spretty\seasy\sto\sfix,\sisn't\sit?\sUnless\sI'm\smissing\ssomething,\snot\senough\sto\sconvince\sme\sI'm\safraid!\r\n\r\nThe\suse\sof\s`TCL_CONVERT_SPACE`\s(it\swas\salso\smy\sfirst\sthought)\sdoes\snot\shelp\sbecause\sit\sdoes\snot\sdistinguish\sbetween\sthe\scaller\snot\sgiving\sa\slarge\senough\sbuffer\sversus\sthe\sfunction\s`Tcl_ExternalToUtf`\s\snot\sbeing\sable\sto\shandle\ssource\slengths\sthat\slarge.\r\n\r\nConsider\sbeing\scalled\swith\ssrcLen=2GB+1\sand\sdstLen=4GB.\sThe\sfunction\swill\sreturn\s`TCL_CONVERT_NOSPACE`\sand\sthe\snatural\sthing\sis\sfor\sthe\scaller\sto\sdouble\sit's\soutput\sbuffer!\sIt\stakes\ssome\sthinking\sand\sadditional\slogic\son\sthe\spart\sof\sthe\sprogrammer\s(and\sI\sguarantee\sthey\swill\snot\seven\srealize\sthis\suntil\sthey\sactually\shit\sa\sbug)\s\sto\sdistinguish\sbetween\sthe\sreal\sdestination\sbuffer\stoo\ssmall\scase\sand\sthe\ssource\sdata\sgreater\sthan\sfunction\slimits.\sNot\sa\sgood\sAPI\sdesign\simo.\r\n\r\nSo\sI\sstill\sthink\sthose\sfunctions\sneed\sto\schange.\sThe\sDString\svariants\scan\scontinue\sto\stake\sTcl_Size\sarguments\ssince\sthere\sis\sno\sconfusion\sthere\swith\soutput\sparameters.\sThey\swill\sneed\sto\sadapt\sto\sloop\scalling\sthe\slower\slevel\sroutines\swhich\sthey\sdo\snow\sanyway.\r\n\r\n/Ashok
J login apnadkarni
J mimetype text/x-markdown
K fb368527aeed240f2b345be96119ea66e1fce6fb
U apnadkarni
Z 4ade3c0f9c2ca3adc2224b325d3ae1fa