diff options
author | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-19 11:24:03 +0000 |
---|---|---|
committer | nobu <nobu@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2017-10-19 11:24:03 +0000 |
commit | 6fd04415db2bf6e25087c197b5cc4a95a7fbb7cb (patch) | |
tree | 23fcbcc611a9ee41e23b0d7ff0edb3f7609b3cbb /test | |
parent | c9a38187dc3b9d159a45f771521e44187f995a1b (diff) | |
download | ruby-6fd04415db2bf6e25087c197b5cc4a95a7fbb7cb.tar.gz |
ruby.c: reject NUL in $0
* ruby.c (ruby_setproctitle): raise if the argument contains NUL
char. process title is a NUL-terminated string.
[ruby-core:82425] [Bug #13829]
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60215 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-rw-r--r-- | test/ruby/test_rubyoptions.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/ruby/test_rubyoptions.rb b/test/ruby/test_rubyoptions.rb index f927af2f2d..beb6a24e93 100644 --- a/test/ruby/test_rubyoptions.rb +++ b/test/ruby/test_rubyoptions.rb @@ -549,6 +549,13 @@ class TestRubyOptions < Test::Unit::TestCase def test_setproctitle skip "platform dependent feature" unless defined?(PSCMD) and PSCMD + assert_separately([], "#{<<-"{#"}\n#{<<-'};'}") + {# + assert_raise(ArgumentError) do + Process.setproctitle("hello\0") + end + }; + with_tmpchdir do write_file("test-script", "$_0 = $0.dup; Process.setproctitle('hello world'); $0 == $_0 or Process.setproctitle('$0 changed!'); sleep 60") |