diff options
| author | donal.k.fellows@manchester.ac.uk <dkf> | 2011-08-30 00:23:16 (GMT) |
|---|---|---|
| committer | donal.k.fellows@manchester.ac.uk <dkf> | 2011-08-30 00:23:16 (GMT) |
| commit | 50eb90178e157e883bf76d3def6e32433f9895cb (patch) | |
| tree | 7190b01a6ab49b73109282aaa892db8e46c80128 /generic/tclInterp.c | |
| parent | d1558c51b0d87aa9c1e8e0e44ae240d9d42342e9 (diff) | |
| parent | 827eea2d7594cfaffb46a99b45ee09be4dd1bd3d (diff) | |
| download | tcl-50eb90178e157e883bf76d3def6e32433f9895cb.zip tcl-50eb90178e157e883bf76d3def6e32433f9895cb.tar.gz tcl-50eb90178e157e883bf76d3def6e32433f9895cb.tar.bz2 | |
[Bug 3398794]: Use Tcl errors in scripts, not panics.
Diffstat (limited to 'generic/tclInterp.c')
| -rw-r--r-- | generic/tclInterp.c | 26 |
1 files changed, 26 insertions, 0 deletions
diff --git a/generic/tclInterp.c b/generic/tclInterp.c index a156a57..5b6d14f 100644 --- a/generic/tclInterp.c +++ b/generic/tclInterp.c @@ -4345,6 +4345,19 @@ SlaveCommandLimitCmd( ScriptLimitCallback *limitCBPtr; Tcl_HashEntry *hPtr; + /* + * First, ensure that we are not reading or writing the calling + * interpreter's limits; it may only manipulate its children. Note that + * the low level API enforces this with Tcl_Panic, which we want to + * avoid. [Bug 3398794] + */ + + if (interp == slaveInterp) { + Tcl_AppendResult(interp, + "limits on current interpreter inaccessible", NULL); + return TCL_ERROR; + } + if (objc == consumedObjc) { Tcl_Obj *dictPtr; @@ -4519,6 +4532,19 @@ SlaveTimeLimitCmd( ScriptLimitCallback *limitCBPtr; Tcl_HashEntry *hPtr; + /* + * First, ensure that we are not reading or writing the calling + * interpreter's limits; it may only manipulate its children. Note that + * the low level API enforces this with Tcl_Panic, which we want to + * avoid. [Bug 3398794] + */ + + if (interp == slaveInterp) { + Tcl_AppendResult(interp, + "limits on current interpreter inaccessible", NULL); + return TCL_ERROR; + } + if (objc == consumedObjc) { Tcl_Obj *dictPtr; |
