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));