summaryrefslogtreecommitdiff
path: root/test/json
diff options
context:
space:
mode:
authorAndrew Bromwich <a.bromwich@gmail.com>2022-04-20 22:30:35 +1000
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2022-05-20 17:49:13 +0900
commita15d0e267a8a429cf2a2a4358080666ee2260526 (patch)
treed2769775dadd891c7975949c76e8d33d1c27bc93 /test/json
parent767f3904ee2a15575c292d89578de7669f169346 (diff)
downloadruby-a15d0e267a8a429cf2a2a4358080666ee2260526.tar.gz
[flori/json] Fix parser bug for empty string allocation
When `HAVE_RB_ENC_INTERNED_STR` is enabled it is possible to pass through a null pointer to `rb_enc_interned_str` resulting in a segfault Fixes #495 https://github.com/flori/json/commit/b59368a8c2
Diffstat (limited to 'test/json')
-rw-r--r--test/json/json_parser_test.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/test/json/json_parser_test.rb b/test/json/json_parser_test.rb
index dce693e548..00b254fc6a 100644
--- a/test/json/json_parser_test.rb
+++ b/test/json/json_parser_test.rb
@@ -84,6 +84,7 @@ class JSONParserTest < Test::Unit::TestCase
assert_equal({ "a" => 23 }, parse(' { "a" : 23 } '))
assert_equal({ "a" => 0.23 }, parse(' { "a" : 0.23 } '))
assert_equal({ "a" => 0.23 }, parse(' { "a" : 0.23 } '))
+ assert_equal({ "" => 123 }, parse('{"":123}'))
end
def test_parse_numbers