summaryrefslogtreecommitdiffstats
path: root/test/ruby/test_econv.rb
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-04 10:15:34 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2008-09-04 10:15:34 +0000
commit61f8b79aee55fe6eb56cc1f68a35ee42675d0320 (patch)
treea0008d75fa81363442708cdaa98272e426bb8415 /test/ruby/test_econv.rb
parent970524f9fa95fef27eeb3f218e182cef4065855c (diff)
downloadruby-61f8b79aee55fe6eb56cc1f68a35ee42675d0320.tar.gz
ruby-61f8b79aee55fe6eb56cc1f68a35ee42675d0320.tar.xz
ruby-61f8b79aee55fe6eb56cc1f68a35ee42675d0320.zip
* include/ruby/encoding.h (ECONV_INVALID_IGNORE): removed because
it tend to cause security problem. If the behaviour is really required, ECONV_INVALID_REPLACE with empty string can be used. For example, CVE-2006-2313, CVE-2008-1036, [ruby-core:15645] (ECONV_UNDEF_IGNORE): ditto. * transcode.c (rb_econv_convert): follow the above change. (econv_opts): ditto. (Init_transcode): ditto. git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@19123 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test/ruby/test_econv.rb')
-rw-r--r--test/ruby/test_econv.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/test/ruby/test_econv.rb b/test/ruby/test_econv.rb
index 684406752..12f652d85 100644
--- a/test/ruby/test_econv.rb
+++ b/test/ruby/test_econv.rb
@@ -524,7 +524,7 @@ class TestEncodingConverter < Test::Unit::TestCase
end
def test_invalid_ignore
- ec = Encoding::Converter.new("UTF-8", "EUC-JP", Encoding::Converter::INVALID_IGNORE)
+ ec = Encoding::Converter.new("UTF-8", "EUC-JP", :invalid => :replace, :replace => "")
ret = ec.primitive_convert(src="abc\x80def", dst="", nil, 100)
assert_equal(:finished, ret)
assert_equal("", src)
@@ -540,7 +540,7 @@ class TestEncodingConverter < Test::Unit::TestCase
end
def test_undef_ignore
- ec = Encoding::Converter.new("UTF-8", "EUC-JP", Encoding::Converter::UNDEF_IGNORE)
+ ec = Encoding::Converter.new("UTF-8", "EUC-JP", :undef => :replace, :replace => "")
ret = ec.primitive_convert(src="abc\u{fffd}def", dst="", nil, 100)
assert_equal(:finished, ret)
assert_equal("", src)