diff options
author | hobbs <hobbs@noemail.net> | 2000-08-06 00:20:09 (GMT) |
---|---|---|
committer | hobbs <hobbs@noemail.net> | 2000-08-06 00:20:09 (GMT) |
commit | 7df25cfe656fcc2d05539569d6602b8bae7637ac (patch) | |
tree | 5b57994f80b33ef43a53b6419a3eba7415934a82 | |
parent | b90db7787ce55d1a4ad472c7f24b826e8a6de414 (diff) | |
download | tcl-7df25cfe656fcc2d05539569d6602b8bae7637ac.zip tcl-7df25cfe656fcc2d05539569d6602b8bae7637ac.tar.gz tcl-7df25cfe656fcc2d05539569d6602b8bae7637ac.tar.bz2 |
* generic/tclIOGT.c (TclChannelTransform): fixed segfault that
would occur when transforming a channel with a proc that did not
yet exist. (Kupries)
* generic/tclTest.c (TestChannelCmd): added some lint init'ing of
statePtr and chan vars.
FossilOrigin-Name: 40872cef19b2050fe3218f5adab4d2aa4e67d42b
-rw-r--r-- | ChangeLog | 9 | ||||
-rw-r--r-- | generic/tclIOGT.c | 18 | ||||
-rw-r--r-- | generic/tclTest.c | 6 |
3 files changed, 22 insertions, 11 deletions
@@ -1,3 +1,12 @@ +2000-08-05 Jeff Hobbs <hobbs@scriptics.com> + + * generic/tclIOGT.c (TclChannelTransform): fixed segfault that + would occur when transforming a channel with a proc that did not + yet exist. (Kupries) + + * generic/tclTest.c (TestChannelCmd): added some lint init'ing of + statePtr and chan vars. + 2000-07-28 Mo DeJong <mdejong@redhat.com> * win/Makefile.in: diff --git a/generic/tclIOGT.c b/generic/tclIOGT.c index 5050603..28095af 100644 --- a/generic/tclIOGT.c +++ b/generic/tclIOGT.c @@ -10,7 +10,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * CVS: $Id: tclIOGT.c,v 1.1.4.1 2000/07/27 01:39:18 hobbs Exp $ + * CVS: $Id: tclIOGT.c,v 1.1.4.2 2000/08/06 00:20:10 hobbs Exp $ */ #include "tclInt.h" @@ -299,7 +299,11 @@ TclChannelTransform(interp, chan, cmdObjPtr) if (dataPtr->self == (Tcl_Channel) NULL) { Tcl_AppendResult(interp, "\nfailed to stack channel \"", Tcl_GetChannelName(chan), "\"", (char *) NULL); - goto cleanup; + + Tcl_DecrRefCount(dataPtr->command); + ResultClear(&dataPtr->result); + ckfree((VOID *) dataPtr); + return TCL_ERROR; } /* @@ -312,7 +316,7 @@ TclChannelTransform(interp, chan, cmdObjPtr) if (res != TCL_OK) { Tcl_UnstackChannel(interp, chan); - goto cleanup; + return TCL_ERROR; } } @@ -325,17 +329,11 @@ TclChannelTransform(interp, chan, cmdObjPtr) NULL, 0, TRANSMIT_DONT, P_NO_PRESERVE); Tcl_UnstackChannel(interp, chan); - goto cleanup; + return TCL_ERROR; } } return TCL_OK; - - cleanup: - Tcl_DecrRefCount(dataPtr->command); - ResultClear(&dataPtr->result); - ckfree((VOID *) dataPtr); - return TCL_ERROR; } /* diff --git a/generic/tclTest.c b/generic/tclTest.c index 1e98921..33f6a58 100644 --- a/generic/tclTest.c +++ b/generic/tclTest.c @@ -13,7 +13,7 @@ * See the file "license.terms" for information on usage and redistribution * of this file, and for a DISCLAIMER OF ALL WARRANTIES. * - * RCS: @(#) $Id: tclTest.c,v 1.17.2.1 2000/07/27 01:39:19 hobbs Exp $ + * RCS: @(#) $Id: tclTest.c,v 1.17.2.2 2000/08/06 00:20:10 hobbs Exp $ */ #define TCL_TEST @@ -4305,6 +4305,10 @@ TestChannelCmd(clientData, interp, argc, argv) statePtr = chanPtr->state; chanPtr = statePtr->topChanPtr; chan = (Tcl_Channel) chanPtr; + } else { + /* lint */ + statePtr = NULL; + chan = NULL; } if ((cmdName[0] == 'i') && (strncmp(cmdName, "info", len) == 0)) { |