aboutsummaryrefslogtreecommitdiffstats
path: root/test/bigdecimal
diff options
context:
space:
mode:
authormrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-02 15:09:49 +0000
committermrkn <mrkn@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-12-02 15:09:49 +0000
commit1fec21fe601c60c347d03dbd8f9ad83b0db677a4 (patch)
tree810c516b5d1875764b68c3fd07f559efb0a23c2f /test/bigdecimal
parentc1e6052bfec1e621c3d2eda598b7f69270e176b8 (diff)
downloadruby-1fec21fe601c60c347d03dbd8f9ad83b0db677a4.tar.gz
* ext/bigdecimal/bigdecimal.c (BigDecimal_new): stop checking string
taintness. [Bug #5508] [ruby-core:40510] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@38147 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/bigdecimal')
-rw-r--r--test/bigdecimal/test_bigdecimal.rb14
1 files changed, 14 insertions, 0 deletions
diff --git a/test/bigdecimal/test_bigdecimal.rb b/test/bigdecimal/test_bigdecimal.rb
index ed4a1d40ab..a06adb1356 100644
--- a/test/bigdecimal/test_bigdecimal.rb
+++ b/test/bigdecimal/test_bigdecimal.rb
@@ -100,6 +100,13 @@ class TestBigDecimal < Test::Unit::TestCase
end
end
+ def test_global_new_with_tainted_string
+ Thread.new {
+ $SAFE = 1
+ BigDecimal('1'.taint)
+ }.join
+ end
+
def test_new
assert_equal(1, BigDecimal.new("1"))
assert_equal(1, BigDecimal.new("1", 1))
@@ -150,6 +157,13 @@ class TestBigDecimal < Test::Unit::TestCase
end
end
+ def test_new_with_tainted_string
+ Thread.new {
+ $SAFE = 1
+ BigDecimal.new('1'.taint)
+ }.join
+ end
+
def _test_mode(type)
BigDecimal.mode(type, true)
assert_raise(FloatDomainError) { yield }