Commit 1e2d4f67 authored by Alexey Botchkov's avatar Alexey Botchkov

MDEV-13971 crash in skip_num_constant.

        Character bigger than 0x60 wasn't handled properly
        inside a numeric constant.
parent dcbf2823
......@@ -725,3 +725,6 @@ json_contains_path('{"foo":"bar"}', 'one', '$[]')
NULL
Warnings:
Warning 4042 Syntax error in JSON path in argument 3 to function 'json_contains_path' at position 3
select JSON_VALID(0x36f0c8dccd83c5eac156da);
JSON_VALID(0x36f0c8dccd83c5eac156da)
0
......@@ -378,3 +378,7 @@ SELECT JSON_OBJECT("user","Jožko Mrkvičká") as json_data;
select json_contains_path('{"foo":"bar"}', 'one', '$[]');
#
# MDEV-13971 crash in skip_num_constant.
#
select JSON_VALID(0x36f0c8dccd83c5eac156da);
......@@ -503,7 +503,7 @@ static int skip_num_constant(json_engine_t *j)
for (;;)
{
j->num_flags|= json_num_state_flags[state];
if ((c_len= json_next_char(&j->s)) > 0)
if ((c_len= json_next_char(&j->s)) > 0 && j->s.c_next < 128)
{
if ((state= json_num_states[state][json_num_chr_map[j->s.c_next]]) > 0)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment