summaryrefslogtreecommitdiffstats
path: root/tests/subst.test
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2004-09-29 19:36:34 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2004-09-29 19:36:34 (GMT)
commitdb28fb893dc50fd54f948ec4bf06c296cb4165f2 (patch)
tree764d635a39043219a6e221c8c71a651b9ac1c9a6 /tests/subst.test
parentc36a55ff0083738d8bd88d1ba5c164046e441f8f (diff)
downloadtcl-db28fb893dc50fd54f948ec4bf06c296cb4165f2.zip
tcl-db28fb893dc50fd54f948ec4bf06c296cb4165f2.tar.gz
tcl-db28fb893dc50fd54f948ec4bf06c296cb4165f2.tar.bz2
fix for buffer overflow in [subst], [Bug 1036649]
Diffstat (limited to 'tests/subst.test')
-rw-r--r--tests/subst.test19
1 files changed, 18 insertions, 1 deletions
diff --git a/tests/subst.test b/tests/subst.test
index 792420a..2cab058 100644
--- a/tests/subst.test
+++ b/tests/subst.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: subst.test,v 1.13.2.2 2003/03/12 18:04:41 dgp Exp $
+# RCS: @(#) $Id: subst.test,v 1.13.2.3 2004/09/29 19:36:37 msofer Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -220,6 +220,23 @@ test subst-11.6 {continue in a variable subst} {
subst {foo $var([continue]) bar}
} {foo bar}
+test subst-12.1 {nasty case, Bug 1036649} {
+ for {set i 0} {$i < 10} {incr i} {
+ set res [list [catch {subst "\[subst {};"} msg] $msg]
+ if {$msg ne "missing close-bracket"} break
+ }
+ set res
+} {1 {missing close-bracket}}
+test subst-12.2 {nasty case, Bug 1036649} {
+ for {set i 0} {$i < 10} {incr i} {
+ list [catch {subst "\[subst {}; "} msg] $msg
+ if {$msg ne "missing close-bracket"} break
+ }
+ set res
+} {1 {missing close-bracket}}
+
+
+
# cleanup
::tcltest::cleanupTests
return