diff options
| author | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-09-19 20:53:32 +0900 |
|---|---|---|
| committer | Yukihiro "Matz" Matsumoto <[email protected]> | 2018-09-19 22:01:59 +0900 |
| commit | c09d250ca148c0efc0167d55885bd20da87b43f7 (patch) | |
| tree | dd1ed14792a5bf45a79d44167556b4206c9698d8 /mrbgems/mruby-enumerator/test/enumerator.rb | |
| parent | 8b43754644660c9dcdc6b8b18a1917f01e77479e (diff) | |
| download | mruby-c09d250ca148c0efc0167d55885bd20da87b43f7.tar.gz mruby-c09d250ca148c0efc0167d55885bd20da87b43f7.zip | |
Remove implicit conversion using `to_int` method.
The ISO standard does not include implicit type conversion using
`to_int`. This implicit conversion often causes vulnerability.
There will be no more attacks like #4120.
In addition, we have added internal convenience method `__to_int` which
does type check and conversion (from floats).
Diffstat (limited to 'mrbgems/mruby-enumerator/test/enumerator.rb')
| -rw-r--r-- | mrbgems/mruby-enumerator/test/enumerator.rb | 6 |
1 files changed, 0 insertions, 6 deletions
diff --git a/mrbgems/mruby-enumerator/test/enumerator.rb b/mrbgems/mruby-enumerator/test/enumerator.rb index 428ea0307..c24b70ccb 100644 --- a/mrbgems/mruby-enumerator/test/enumerator.rb +++ b/mrbgems/mruby-enumerator/test/enumerator.rb @@ -55,12 +55,6 @@ assert 'Enumerator#with_index' do assert_equal [[[1, 10], 20], [[2, 11], 21], [[3, 12], 22]], a end -assert 'Enumerator#with_index nonnum offset' do - s = Object.new - def s.to_int; 1 end - assert_equal([[1,1],[2,2],[3,3]], @obj.to_enum(:foo, 1, 2, 3).with_index(s).to_a) -end - assert 'Enumerator#with_index string offset' do assert_raise(TypeError){ @obj.to_enum(:foo, 1, 2, 3).with_index('1').to_a } end |
