summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorAndrew Bromwich <a.bromwich@gmail.com>2022-04-20 22:30:35 +1000
committerAndrew Bromwich <a.bromwich@gmail.com>2022-04-20 22:30:35 +1000
commitb59368a8c23976d9e44adc8f8c284fdd954a0d33 (patch)
treedf9f1fec281b6711552d7f1d7309e22fcf07c72b /tests
parent75ada77b9664c1d1f0ae6e210f8db4919849561e (diff)
downloadjson-b59368a8c23976d9e44adc8f8c284fdd954a0d33.tar.gz
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
Diffstat (limited to 'tests')
-rw-r--r--tests/json_parser_test.rb1
1 files changed, 1 insertions, 0 deletions
diff --git a/tests/json_parser_test.rb b/tests/json_parser_test.rb
index dce693e..00b254f 100644
--- a/tests/json_parser_test.rb
+++ b/tests/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