diff options
| author | Jean Boussier <jean.boussier@gmail.com> | 2026-05-12 08:49:34 +0200 |
|---|---|---|
| committer | git <svn-admin@ruby-lang.org> | 2026-05-12 07:07:28 +0000 |
| commit | 95c041bd3bdf0af0be00ed8546947dc73dc92897 (patch) | |
| tree | 45cd89322c8d84124b9c6085be50bb1306b8e733 /test | |
| parent | fb369617736b868e6896426c1135fbe23f34cecd (diff) | |
[ruby/json] generator.c: Handle stupidly large depth
https://github.com/ruby/json/commit/1d32bd4596
Diffstat (limited to 'test')
| -rwxr-xr-x | test/json/json_generator_test.rb | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/test/json/json_generator_test.rb b/test/json/json_generator_test.rb index 1cfd19da12..87d9cd7f7d 100755 --- a/test/json/json_generator_test.rb +++ b/test/json/json_generator_test.rb @@ -1081,4 +1081,15 @@ class JSONGeneratorTest < Test::Unit::TestCase end end + def test_large_depth_raises + assert_raise(RangeError, ArgumentError) do + JSON.generate([[1]], + indent: " " * 5, + array_nl: "\n", + depth: 3_689_348_814_741_910_324, + max_nesting: 0 + ) + end + end + end |
