summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ext/json/parser/parser.c2
-rw-r--r--test/json/json_parser_test.rb8
2 files changed, 9 insertions, 1 deletions
@@ -630,7 +630,7 @@ static VALUE json_string_unescape(JSON_ParserState *state, const char *string, c
unescape = (char *) "\f";
break;
case 'u':
- if (pe > stringEnd - 4) {
raise_parse_error("incomplete unicode character escape sequence at '%s'", p);
} else {
uint32_t ch = unescape_unicode((unsigned char *) ++pe);
@@ -302,6 +302,14 @@ class JSONParserTest < Test::Unit::TestCase
end
end
def test_parse_big_integers
json1 = JSON(orig = (1 << 31) - 1)
assert_equal orig, parse(json1)