1
0
Fork 0
mirror of https://github.com/ruby/ruby.git synced 2022-11-09 12:17:21 -05:00

Remove the 65 size limit for name_err_mesg_to_str

This limit was introduced on Nov 20 1996
in 554b989ba1

Apparently to protect from a buffer overflow:

  * eval.c (f_missing): オブジェクトの文字列表現が長すぎる時バッファ
	  を書き潰していた

However I tested that path with very large strings
and it works fine.
This commit is contained in:
Jean Boussier 2020-05-07 21:49:40 +02:00 committed by Aaron Patterson
parent 15e977349e
commit 1258a0fb90
Notes: git 2020-05-12 01:15:58 +09:00
2 changed files with 14 additions and 1 deletions

View file

@ -127,4 +127,17 @@ class TestNameError < Test::Unit::TestCase
-> {require ARGV[0]}.call
end;
end
def test_large_receiver_inspect
receiver = Class.new do
def self.inspect
'A' * 120
end
end
error = assert_raise(NameError) do
receiver::FOO
end
assert_equal "uninitialized constant #{'A' * 120}::FOO", error.message
end
end