diff options
author | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-06-20 14:52:45 +0000 |
---|---|---|
committer | nagai <nagai@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2003-06-20 14:52:45 +0000 |
commit | ff75ab3e3cd76b1b457661edf6b20661d45c8d78 (patch) | |
tree | a294a67d15b5f342105b117b547d32d89ed77b6e /ext | |
parent | f289fddace1c84075e6794e24a3d46aee6b35d69 (diff) | |
download | ruby-ff75ab3e3cd76b1b457661edf6b20661d45c8d78.tar.gz |
tcltklib.c :
* Tk interpreter returns TAINTED strings.
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@3968 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'ext')
-rw-r--r-- | ext/tcltklib/tcltklib.c | 12 | ||||
-rw-r--r-- | ext/tk/lib/tk.rb | 7 |
2 files changed, 12 insertions, 7 deletions
diff --git a/ext/tcltklib/tcltklib.c b/ext/tcltklib/tcltklib.c index 06322b54f1..9f6f54b5cc 100644 --- a/ext/tcltklib/tcltklib.c +++ b/ext/tcltklib/tcltklib.c @@ -635,7 +635,8 @@ ip_eval(self, str) DUMP2("(TCL_Eval result) %d", ptr->return_value); /* pass back the result (as string) */ - return(rb_str_new2(ptr->ip->result)); + /* return(rb_str_new2(ptr->ip->result)); */ + return(rb_tainted_str_new2(ptr->ip->result)); } @@ -665,7 +666,8 @@ ip_toUTF8(self, str, encodename) Tcl_DStringInit(&dstr); Tcl_DStringFree(&dstr); Tcl_ExternalToUtfDString(encoding,buf,strlen(buf),&dstr); - str = rb_str_new2(Tcl_DStringValue(&dstr)); + /* str = rb_str_new2(Tcl_DStringValue(&dstr)); */ + str = rb_tainted_str_new2(Tcl_DStringValue(&dstr)); Tcl_FreeEncoding(encoding); Tcl_DStringFree(&dstr); @@ -699,7 +701,8 @@ ip_fromUTF8(self, str, encodename) Tcl_DStringInit(&dstr); Tcl_DStringFree(&dstr); Tcl_UtfToExternalDString(encoding,buf,strlen(buf),&dstr); - str = rb_str_new2(Tcl_DStringValue(&dstr)); + /* str = rb_str_new2(Tcl_DStringValue(&dstr)); */ + str = rb_tainted_str_new2(Tcl_DStringValue(&dstr)); Tcl_FreeEncoding(encoding); Tcl_DStringFree(&dstr); @@ -796,7 +799,8 @@ ip_invoke_real(argc, argv, obj) } /* pass back the result (as string) */ - return rb_str_new2(ptr->ip->result); + /* return rb_str_new2(ptr->ip->result); */ + return rb_tainted_str_new2(ptr->ip->result); } VALUE diff --git a/ext/tk/lib/tk.rb b/ext/tk/lib/tk.rb index 464f7f179e..c1550680cc 100644 --- a/ext/tk/lib/tk.rb +++ b/ext/tk/lib/tk.rb @@ -847,13 +847,14 @@ module TkCore args.flatten! print "=> ", args.join(" ").inspect, "\n" if $DEBUG begin - res = INTERP._invoke(*args) + # res = INTERP._invoke(*args).taint + res = INTERP._invoke(*args) # _invoke returns a TAITED string rescue NameError err = $! begin args.unshift "unknown" - #res = INTERP._invoke(*args) - res = INTERP._invoke(*args).taint + #res = INTERP._invoke(*args).taint + res = INTERP._invoke(*args) # _invoke returns a TAITED string rescue fail unless /^invalid command/ =~ $! fail err |