Skip to content
Tcl Source Code Artifact [c1e3c4a857]
Login

Artifact [c1e3c4a857]

Artifact c1e3c4a857a5767bf888e91ad5846363f80d37d6:

Manifest of check-in [c1e3c4a857] - * generic/tclIOCmd.c (Tcl_GetsObjCmd): Fixed bug #504642 as reported by Brian Griffin <[email protected]>, using his patch. Before the patch the generic I/O layer held an unannounced reference to the interp result to store the read line into. This unfortunately has disastrous results if the channel driver executes a tcl script to perform its operation, this freeing the interp result. In that case we are dereferencing essentially a dangling reference. It is not truly dangling because the object is in the free list, but this only causes us to smash the free list and have the error occur later somewhere else. The patch simply creates a new object for the line and later sets it into the interp result when we are done with reading. by andreas_kupries on 2002-01-17 20:35:20.
B 28b6020550dd9e62f46b824e4c2ba2a6302657f6
C \n\t*\sgeneric/tclIOCmd.c\s(Tcl_GetsObjCmd):\sFixed\sbug\s#504642\sas\n\t\s\sreported\sby\sBrian\sGriffin\s<[email protected]>,\n\t\s\susing\shis\spatch.\sBefore\sthe\spatch\sthe\sgeneric\sI/O\slayer\sheld\san\n\t\s\sunannounced\sreference\sto\sthe\sinterp\sresult\sto\sstore\sthe\sread\n\t\s\sline\sinto.\sThis\sunfortunately\shas\sdisastrous\sresults\sif\sthe\n\t\s\schannel\sdriver\sexecutes\sa\stcl\sscript\sto\sperform\sits\soperation,\n\t\s\sthis\sfreeing\sthe\sinterp\sresult.\sIn\sthat\scase\swe\sare\n\t\s\sdereferencing\sessentially\sa\sdangling\sreference.\sIt\sis\snot\struly\n\t\s\sdangling\sbecause\sthe\sobject\sis\sin\sthe\sfree\slist,\sbut\sthis\sonly\n\t\s\scauses\sus\sto\ssmash\sthe\sfree\slist\sand\shave\sthe\serror\soccur\slater\n\t\s\ssomewhere\selse.\sThe\spatch\ssimply\screates\sa\snew\sobject\sfor\sthe\n\t\s\sline\sand\slater\ssets\sit\sinto\sthe\sinterp\sresult\swhen\swe\sare\sdone\n\t\s\swith\sreading.\n
D 2002-01-17T20:35:20
F ChangeLog 8f93584dc2913c1f4f4ea912e272f26c848f931d
F doc/DString.3 87f328a776977d97ce04ef3df6970f12d70ce07c
F generic/tclIOCmd.c 93aaa6326302bad8cdc515611fb0154922126031
P 05a0a92d54159324cc71fb471c764120cfdd65c0
U andreas_kupries
Z a6db30cb69ca2656429e008d43e3f178