summaryrefslogtreecommitdiffstats
path: root/tests/subst.test
diff options
context:
space:
mode:
authorMiguel Sofer <miguel.sofer@gmail.com>2002-02-25 23:17:21 (GMT)
committerMiguel Sofer <miguel.sofer@gmail.com>2002-02-25 23:17:21 (GMT)
commit1690e4866895623a276336a661c86f89b9207477 (patch)
treef276f158f540b6af512dd82cee94bbc3bae1eacf /tests/subst.test
parent9eab669dcad29058d8581e85692326a2c0beed04 (diff)
downloadtcl-1690e4866895623a276336a661c86f89b9207477.zip
tcl-1690e4866895623a276336a661c86f89b9207477.tar.gz
tcl-1690e4866895623a276336a661c86f89b9207477.tar.bz2
avoiding a buffer overrun in [subst]; restoring tcl7.6 behaviour [Bug #495207]
Diffstat (limited to 'tests/subst.test')
-rw-r--r--tests/subst.test14
1 files changed, 13 insertions, 1 deletions
diff --git a/tests/subst.test b/tests/subst.test
index 662db99..f9e3e78 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.9 2001/07/12 13:15:09 dkf Exp $
+# RCS: @(#) $Id: subst.test,v 1.10 2002/02/25 23:17:21 msofer Exp $
if {[lsearch [namespace children] ::tcltest] == -1} {
package require tcltest
@@ -82,6 +82,18 @@ test subst-5.3 {command substitutions} {
test subst-5.4 {command substitutions} {
list [catch {subst {$long [set long] [bogus_command]}} msg] $msg
} {1 {invalid command name "bogus_command"}}
+test subst-5.5 {command substitutions} {
+ set a 0
+ list [catch {subst {[set a 1}} msg] $a $msg
+} {1 0 {missing close-bracket}}
+test subst-5.6 {command substitutions} {
+ set a 0
+ list [catch {subst {0[set a 1}} msg] $a $msg
+} {1 0 {missing close-bracket}}
+test subst-5.7 {command substitutions} {
+ set a 0
+ list [catch {subst {0[set a 1; set a 2}} msg] $a $msg
+} {1 1 {missing close-bracket}}
test subst-6.1 {clear the result after command substitution} {
catch {unset a}