summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormig <mig>2011-04-13 13:23:45 (GMT)
committermig <mig>2011-04-13 13:23:45 (GMT)
commit1c28a4ad0359711950277af2f24dca1a1b7cd041 (patch)
tree087fd57082e97a3b84c1692414ad125c0ae45994
parent4884764d1d8d9cf7bd61e25622b0173c43e46114 (diff)
parentff0738ff2d537d9c4d0d95d944bfd0a239baef8e (diff)
downloadtcl-1c28a4ad0359711950277af2f24dca1a1b7cd041.zip
tcl-1c28a4ad0359711950277af2f24dca1a1b7cd041.tar.gz
tcl-1c28a4ad0359711950277af2f24dca1a1b7cd041.tar.bz2
fix for [Bug 2662380], crash caused by appending to a variable with a write trace that unsets it
-rw-r--r--ChangeLog5
-rw-r--r--generic/tclVar.c7
2 files changed, 9 insertions, 3 deletions
diff --git a/ChangeLog b/ChangeLog
index 7bf374c..71057c6 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2011-04-13 Miguel Sofer <msofer@users.sf.net>
+
+ * generic/tclVar.c: fix for [Bug 2662380], crash caused by
+ appending to a variable with a write trace that unsets it.
+
2011-04-13 Donal K. Fellows <dkf@users.sf.net>
* generic/tclUtil.c (Tcl_ConcatObj): [Bug 3285375]: Make the crash
diff --git a/generic/tclVar.c b/generic/tclVar.c
index 28151c0..b735ba3 100644
--- a/generic/tclVar.c
+++ b/generic/tclVar.c
@@ -2670,13 +2670,14 @@ Tcl_AppendObjCmd(
/*
* Note that we do not need to increase the refCount of the Var
* pointers: should a trace delete the variable, the return value
- * of TclPtrSetVar will be NULL, and we will not access the
- * variable again.
+ * of TclPtrSetVar will be NULL or emptyObjPtr, and we will not
+ * access the variable again.
*/
varValuePtr = TclPtrSetVar(interp, varPtr, arrayPtr, objv[1],
NULL, objv[i], TCL_APPEND_VALUE|TCL_LEAVE_ERR_MSG, -1);
- if (varValuePtr == NULL) {
+ if ((varValuePtr == NULL) ||
+ (varValuePtr == ((Interp *) interp)->emptyObjPtr)) {
return TCL_ERROR;
}
}