<i>extend maximum command length to maxint</i> status still Open with 4 other changes
by
.
D 2009-10-20T04:46:56
J icomment \nThe\sproblem\sto\savoid\sis\swhen\sthe\s"length"\svalue\npassed\sto\sTcl_(Attempt)SetObjLength\sno\slonger\nreally\srepresents\swhat\sthe\scaller\sdesires\sbecause\nof\sinteger\soverflow.\s\sThe\sreally\strouble\ssome\scase\nis\swhen\soffset\sis\salready\sINT_MAX.\s\sThen\sthe\ndoubling\srule\sled\sto\san\sattempt\sto\sallocate\sa\snew\nstring\sof\slength\s2*offset\s+\sTCL_UTF_MAX\s+\s1,\nwhich\swraps\saround\sthe\sunsigned\sinteger\srange\nand\sallocates\sa\sstring\sof\slength\s2.\s\sThen\slater\ncode\stries\sto\swrite\slong\sstrings\sinto\sa\sbuffer\sof\slength\n2\sand\ssegfaults.\n\nShifting\sthe\slocation\sof\sthe\sTCL_UTF_MAX\soffset\nin\sthe\scalculation\smeans\sthat\sthe\scalculation\sof\nlength\sis\slimited\sto\s2*offset,\swhich\scan\sbe\sno\sbigger\nthat\sUINT_MAX\s-1,\swhich\swhen\sinterpreted\sas\sa\ssigned\nint\sis\snegative,\sand\striggers\sthe\sappropriate\sfailure.\n\nThe\swhole\sTCL_UTF_MAX\sshifting\sbusiness\sis\sneeded\nto\ssatisfy\sthe\sdemands\sof\sthe\sTcl_ExternalToUtf()\sroutine.\n\nThe\s+1\sthat\sused\sto\sbe\sthere\swas\sapparently\sin\splace\sto\nmake\ssure\sthat\sspace\sfor\sa\sterminating\sNUL\swas\sallocated.\nSince\sthe\sTcl_*SetObjLength()\sroutines\salready\sprovide\nfor\sthis,\sit\swas\sremoved.\n
J login dgp
J mimetype text/plain
J username dgp
K 2107634fffffffffffffffffffffffffffffffff
U dgp
Z 647b8deb52ea5d67b2b363c14e9941e2