From abe971219456b1f41923c06ff715fd4efeb02850 Mon Sep 17 00:00:00 2001 From: Rucha Deodhar Date: Tue, 1 Mar 2022 16:14:36 +0530 Subject: MDEV-27972: Unexpected behavior with negative zero (-0) in JSON Path Analysis: When we have '-' followed by 0, then the state is changed to JE_SYN, meaning syntax error. Fix: Change the state to PS_INT instead, because we are reading '0' next (integer) and it is not a syntax error. --- strings/json_lib.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'strings/json_lib.c') diff --git a/strings/json_lib.c b/strings/json_lib.c index 526a55b7179..602a57cc03b 100644 --- a/strings/json_lib.c +++ b/strings/json_lib.c @@ -1079,7 +1079,7 @@ static int json_path_transitions[N_PATH_STATES][N_PATH_CLASSES]= /* AWD */ { JE_EOS, JE_SYN, JE_SYN, JE_SYN, PS_PT, JE_SYN,JE_SYN, JE_SYN, JE_SYN, JE_SYN, JE_SYN, PS_AS, JE_SYN, JE_SYN, JE_SYN, JE_NOT_JSON_CHR, JE_BAD_CHR}, -/* NEG */ { JE_EOS, JE_SYN, JE_SYN, JE_SYN, JE_SYN, JE_SYN, JE_SYN,JE_SYN, +/* NEG */ { JE_EOS, JE_SYN, JE_SYN, JE_SYN, JE_SYN, JE_SYN, JE_SYN, PS_INT, PS_INT, JE_SYN, JE_SYN, JE_SYN, JE_SYN, JE_SYN, JE_SYN, JE_NOT_JSON_CHR, JE_BAD_CHR}, /* Z */ { JE_EOS, JE_SYN, JE_SYN, JE_SYN, PS_PT, JE_SYN,JE_SYN, JE_SYN, -- cgit v1.2.1