Commit 0a1d9d06 authored by Sergei Golubchik's avatar Sergei Golubchik

MDEV-27415 main.json_normalize and main.json_equals fail with UBSAN runtime error

UBSAN: out of bound array read in json

json_lib.c:847:25: runtime error: index 200 out of bounds for type 'json_string_char_classes [128]'
json_lib.c:847:25: runtime error: load of address 0x56286f7175a0 with insufficient space for an object of type 'json_string_char_classes'

fixes main.json_equals  and main.json_normalize
parent fd132be1
...@@ -844,7 +844,7 @@ static int skip_key(json_engine_t *j) ...@@ -844,7 +844,7 @@ static int skip_key(json_engine_t *j)
{ {
int t_next, c_len; int t_next, c_len;
if (json_instr_chr_map[j->s.c_next] == S_BKSL && if (j->s.c_next< 128 && json_instr_chr_map[j->s.c_next] == S_BKSL &&
json_handle_esc(&j->s)) json_handle_esc(&j->s))
return 1; return 1;
......
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