diff options
| author | Jean Boussier <jean.boussier@gmail.com> | 2025-01-20 08:34:40 +0100 |
|---|---|---|
| committer | Jean Boussier <jean.boussier@gmail.com> | 2025-01-20 10:31:56 +0100 |
| commit | 33708f2dc4f8327aa70fe10a53423b13da85e69e (patch) | |
| tree | dbdca13fbfcaecf8ae8bffaa98bcdff8df1f7372 /test | |
| parent | 4404688a0e9e606aea870d79f5e8be6ac1524335 (diff) | |
[ruby/json] Fix a regression in the parser with leading /
Ref: https://github.com/ruby/ruby/pull/12598
This could lead to an infinite loop.
https://github.com/ruby/json/commit/f8cfa2696a
Notes
Notes:
Merged: https://github.com/ruby/ruby/pull/12600
Diffstat (limited to 'test')
| -rw-r--r-- | test/json/json_parser_test.rb | 7 |
1 files changed, 7 insertions, 0 deletions
diff --git a/test/json/json_parser_test.rb b/test/json/json_parser_test.rb index 5956200893..c5ce02320f 100644 --- a/test/json/json_parser_test.rb +++ b/test/json/json_parser_test.rb @@ -629,6 +629,13 @@ class JSONParserTest < Test::Unit::TestCase end end + def test_parse_leading_slash + # ref: https://github.com/ruby/ruby/pull/12598 + assert_raise(JSON::ParserError) do + JSON.parse("/foo/bar") + end + end + private def string_deduplication_available? |
