summaryrefslogtreecommitdiffstats
path: root/tests/compile.test
diff options
context:
space:
mode:
authordkf <donal.k.fellows@manchester.ac.uk>2002-03-15 15:39:06 (GMT)
committerdkf <donal.k.fellows@manchester.ac.uk>2002-03-15 15:39:06 (GMT)
commite51eaf9011544d3ccb2756c1e458cc42aeddd877 (patch)
tree9f578d4be03050603948e19b5188a382731b945f /tests/compile.test
parent93f80c911dda1024d86d0faf63274fa858cc60f1 (diff)
downloadtcl-e51eaf9011544d3ccb2756c1e458cc42aeddd877.zip
tcl-e51eaf9011544d3ccb2756c1e458cc42aeddd877.tar.gz
tcl-e51eaf9011544d3ccb2756c1e458cc42aeddd877.tar.bz2
Fixed buffer overrun reported in 530320; luckily it is not likely to
be exploitable in any meaningful way, but crashing Tcl instead of triggering an error still isn't good.
Diffstat (limited to 'tests/compile.test')
-rw-r--r--tests/compile.test9
1 files changed, 8 insertions, 1 deletions
diff --git a/tests/compile.test b/tests/compile.test
index 03f8295..7086de5 100644
--- a/tests/compile.test
+++ b/tests/compile.test
@@ -11,7 +11,7 @@
# See the file "license.terms" for information on usage and redistribution
# of this file, and for a DISCLAIMER OF ALL WARRANTIES.
#
-# RCS: @(#) $Id: compile.test,v 1.17 2001/12/06 10:59:17 dkf Exp $
+# RCS: @(#) $Id: compile.test,v 1.18 2002/03/15 15:39:07 dkf Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -285,6 +285,13 @@ test compile-12.2 {testing error on literal deletion} {memDebug execCommandExist
catch {::tcltest::removeFile source.file}
set res
} 0
+# Test to catch buffer overrun in TclCompileTokens from buf 530320
+test compile-12.3 {check for a buffer overrun} {
+ proc crash {} {
+ puts $array([expr {a+2}])
+ }
+ list [catch crash msg] $msg
+} {1 {syntax error in expression "a+2": variable references require preceding $}}
# Special test for underestimating the maxStackSize required for a
# compiled command. A failure will cause a segfault in the child