diff options
author | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-02-22 07:21:15 (GMT) |
---|---|---|
committer | jan.nijtmans <nijtmans@users.sourceforge.net> | 2023-02-22 07:21:15 (GMT) |
commit | 5219c94af582e25644cda9972735c8c913efc24e (patch) | |
tree | 313469a3faa7a2294980107c2a8374119404c4c6 /generic | |
parent | 5866ef6d2acf4db24499c820df08a8feb88ea865 (diff) | |
parent | 417f86869302e367a498d61a8bed0aa755746517 (diff) | |
download | tcl-5219c94af582e25644cda9972735c8c913efc24e.zip tcl-5219c94af582e25644cda9972735c8c913efc24e.tar.gz tcl-5219c94af582e25644cda9972735c8c913efc24e.tar.bz2 |
Fix [534172ff5b]: Crash in DeleteReflectedChannelMap (introduced via tcllib 1.21)
Diffstat (limited to 'generic')
-rw-r--r-- | generic/tclIORChan.c | 12 |
1 files changed, 7 insertions, 5 deletions
diff --git a/generic/tclIORChan.c b/generic/tclIORChan.c index 7ea50c8..8c6f25f 100644 --- a/generic/tclIORChan.c +++ b/generic/tclIORChan.c @@ -1128,8 +1128,8 @@ ReflectClose( /* * This call comes from TclFinalizeIOSystem. There are no * interpreters, and therefore we cannot call upon the handler command - * anymore. Threading is irrelevant as well. We simply clean up all - * our C level data structures and leave the Tcl level to the other + * anymore. Threading is irrelevant as well. Simply clean up all + * the C level data structures and leave the Tcl level to the other * finalization functions. */ @@ -2697,6 +2697,7 @@ DeleteThreadReflectedChannelMap( Tcl_ThreadId self = Tcl_GetCurrentThread(); ReflectedChannelMap *rcmPtr; /* The map */ ForwardingResult *resultPtr; + ThreadSpecificData *tsdPtr = TCL_TSD_INIT(&dataKey); (void)dummy; /* @@ -2777,6 +2778,7 @@ DeleteThreadReflectedChannelMap( */ rcmPtr = GetThreadReflectedChannelMap(); + tsdPtr->rcmPtr = NULL; for (hPtr = Tcl_FirstHashEntry(&rcmPtr->map, &hSearch); hPtr != NULL; hPtr = Tcl_FirstHashEntry(&rcmPtr->map, &hSearch)) { @@ -3083,10 +3085,10 @@ ForwardProc( (paramPtr->seek.seekMode==SEEK_SET) ? "start" : (paramPtr->seek.seekMode==SEEK_CUR) ? "current" : "end", -1); - Tcl_IncrRefCount(offObj); - Tcl_IncrRefCount(baseObj); + Tcl_IncrRefCount(offObj); + Tcl_IncrRefCount(baseObj); - Tcl_Preserve(rcPtr); + Tcl_Preserve(rcPtr); if (InvokeTclMethod(rcPtr, METH_SEEK, offObj, baseObj, &resObj)!=TCL_OK){ ForwardSetObjError(paramPtr, resObj); paramPtr->seek.offset = -1; |