From e327707ac6abb8f1809527532bba1cd0563dc6da Mon Sep 17 00:00:00 2001 From: Ihor Andrianov Date: Sat, 15 Mar 2025 22:01:48 +0200 Subject: [PATCH] Fix json_path broken condition --- core/json/json_path.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/core/json/json_path.rs b/core/json/json_path.rs index 33631e469..1412ada9e 100644 --- a/core/json/json_path.rs +++ b/core/json/json_path.rs @@ -328,7 +328,9 @@ fn finalize_path<'a>( PPState::InKey => { if key_start < path.len() { let key = &path[key_start..]; - if key.starts_with('"') & !key.ends_with('"') { + if key.starts_with('"') && !key.ends_with('"') && key.len() > 1 + || (key.starts_with('"') && key.ends_with('"') && key.len() == 1) + { bail_parse_error!("Bad json path: {}", path) } path_components.push(PathElement::Key(Cow::Borrowed(key), false));