.
D 2012-02-04T18:04:55
J assignee nobody
J cmimetype text/plain
J comment [append\svar1\s$var2],\sdata-corruption,\se.g.,\srandom\sbytes\sfrom\smemory,\sshow\sup\sin\s$var1\n\nproblem\straced\sto\scheckin\sf0785bb73d1ccd8a524b32c53d457c63b6bb912f,\schanges\sto\sAppendUnicodeToUnicodeRep,\s\n\n\s\s\s\s\s\s\s\sif\s(unicode\s>=\sstringPtr->unicode\s&&\sunicode\s<=\sstringPtr->unicode\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s+\s1\s+\sstringPtr->uallocated\s/\ssizeof(Tcl_UniChar))\s{\n\s\s\s\s\s\s\s\s\s\s\s\soffset\s=\sunicode\s-\sstringPtr->unicode;\n\s\s\s\s\s\s\s\s}\n\nthe\s"+1"\sseems\sto\scause\sa\scomparison\swith\sthe\spointer\simmediately\ssubsequent\sto\nthe\sboundaries\sof\sstringPtr,\sand\scausing\sthe\s'unicode'\sto\spoint\sto\sthe\swrong\nlocation\safter\sthe\sensuing\srealloc\sand\soffset\smanipulations.\s\sRemoving\sresulted\nthe\sbug\sdisappearing:\n\n\s\s\s\s\s\s\s\sif\s(unicode\s>=\sstringPtr->unicode\s&&\sunicode\s<=\sstringPtr->unicode\n\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s\s+\sstringPtr->uallocated\s/\ssizeof(Tcl_UniChar))\s{\n\s\s\s\s\s\s\s\s\s\s\s\soffset\s=\sunicode\s-\sstringPtr->unicode;\n\s\s\s\s\s\s\s\s}\n\nin\sorder\sfor\sthe\sbug\sto\sbe\striggered,\sthings\shave\sto\sfall\sjust-so\sin\smemory,\ssuch\nthat\s"unicode"\sis\sat\sthe\snext\saddress\sup\sfrom\sstringPtr.\n
J foundin obsolete:\s8.5.11
J is_private 0
J priority 5\sMedium
J resolution None
J status Open
J submitter pooryorick
J subsystem 69.\sOther
J title off-by-one\saddress\serror\sin\sAppendUnicodeToUnicodeRep
J type Bug
K 3484402fffffffffffffffffffffffffffffffff
U pooryorick
Z a98390e0ad7e91ca8c1af417aae36504