summaryrefslogtreecommitdiffstats
path: root/generic/tclAssembly.c
diff options
context:
space:
mode:
authorKevin B Kenny <kennykb@acm.org>2016-05-13 00:45:55 (GMT)
committerKevin B Kenny <kennykb@acm.org>2016-05-13 00:45:55 (GMT)
commit885379e2ccc831e0b77425a16e57e9a41a703a8c (patch)
tree9316ab2b0905ab5213f9fdb4e24233f83563821b /generic/tclAssembly.c
parent8e5a574ac054782c904f88a1fe3af0eb54a42f1e (diff)
parent024bab411658378d39fd0d8a6ce363b72cdebacd (diff)
downloadtcl-885379e2ccc831e0b77425a16e57e9a41a703a8c.zip
tcl-885379e2ccc831e0b77425a16e57e9a41a703a8c.tar.gz
tcl-885379e2ccc831e0b77425a16e57e9a41a703a8c.tar.bz2
Bug fix: Assembler dereferences a rogue pointer when unstacking an empty exception range.
Diffstat (limited to 'generic/tclAssembly.c')
-rw-r--r--generic/tclAssembly.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/generic/tclAssembly.c b/generic/tclAssembly.c
index 6d5676b..f56da8f 100644
--- a/generic/tclAssembly.c
+++ b/generic/tclAssembly.c
@@ -3984,10 +3984,12 @@ UnstackExpiredCatches(
while (catchDepth > bbPtr->catchDepth) {
--catchDepth;
- range = envPtr->exceptArrayPtr + catchIndices[catchDepth];
- range->numCodeBytes = bbPtr->startOffset - range->codeOffset;
- catches[catchDepth] = NULL;
- catchIndices[catchDepth] = -1;
+ if (catches[catchDepth] != NULL) {
+ range = envPtr->exceptArrayPtr + catchIndices[catchDepth];
+ range->numCodeBytes = bbPtr->startOffset - range->codeOffset;
+ catches[catchDepth] = NULL;
+ catchIndices[catchDepth] = -1;
+ }
}
/*