Skip to content
Tcl Source Code Artifact [2af3ced5a9]
Login

Artifact [2af3ced5a9]

Artifact 2af3ced5a9b0261086ca5d41b164031859b9b33b19a56fe4a13a8f94136af159:

Ticket change [2af3ced5a9] - Ticket [da63e4c1efcfc3e6|da63e4c1ef] <i>Crash in Tcl_WriteChars()</i> status still Open with 3 other changes by anonymous on 2022-11-23 09:38:36.
D 2022-11-23T09:38:36.107
J icomment The\sproblem\sseems\sto\sbe,\sthat\safter\r\n\r\n\s\s\s\sobjPtr\s=\sTcl_NewStringObj(src,\slen);\r\n\s\s\s\scopy\s=\sTclNarrowToBytes(objPtr);\r\n\r\nobjPtr\sand\scopy\spoint\sto\sthe\ssame\sTcl_Obj,\sand\r\nthat\safter\sthe\sTclDecrRefCount\sin\r\n\r\n\s\s\s\ssrc\s=\s(char\s*)\sTcl_GetByteArrayFromObj(copy,\s&len);\r\n\s\s\s\sTclDecrRefCount(objPtr);\r\n\r\nalso\sthe\sobject\spointed\sto\sby\scopy\sis\scleared,\ssuch\sthat\r\nthe\sfinal\s\r\n\r\n\s\s\s\sTclDecrRefCount(copy);\r\n\r\ncauses\sthe\scrash.\sSo,\sit\slooks\sto\sme,\sthat\seither\sadding\s\r\none\sTcl_IncrRefCount()\sor\sremoving\sone\sof\sthe\sTclDecrRefCount()\r\nsolves\sthe\sissue.\sTclNarrowToBytes()\sseems\sto\sreturn\salways\r\nthe\ssame\sobject,\sor\sremoving\sthe\sfirst\sTclDecrRefCount(objPtr)\sseems\r\nok.
J login anonymous
J mimetype text/plain
K da63e4c1efcfc3e68fdc4527df6a8109e1eac348
U anonymous
Z 834c8fb3fcb694f23cc528e23cb6bc69