From a4f0ae7c18f8056d51b5bcf97df597a66a3ccade Mon Sep 17 00:00:00 2001 From: Sergei Golubchik Date: Fri, 18 Feb 2022 16:21:08 +0100 Subject: [PATCH] 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 --- strings/json_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/strings/json_lib.c b/strings/json_lib.c index 99c44363d64..b5b6dd6516d 100644 --- a/strings/json_lib.c +++ b/strings/json_lib.c @@ -844,7 +844,7 @@ static int skip_key(json_engine_t *j) { 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)) return 1;