aboutsummaryrefslogtreecommitdiff
path: root/src/json.c
diff options
context:
space:
mode:
authordrh <>2022-04-04 14:24:14 +0000
committerdrh <>2022-04-04 14:24:14 +0000
commitb07fb4f1c27609c40b8d1d417f9c8db3e5f7f402 (patch)
tree9156cb49f774ab05c09a1e5db9b5d53ef86d5fb5 /src/json.c
parenta81a9f78fdb1b017c341c54d4602c1dee75c1a23 (diff)
downloadsqlite-b07fb4f1c27609c40b8d1d417f9c8db3e5f7f402.tar.gz
sqlite-b07fb4f1c27609c40b8d1d417f9c8db3e5f7f402.zip
Fix the JSON Path parser so that it will accept zero-length object labels.
[forum/forumpost/c082aeab43|Forum thread c082aeab43]. FossilOrigin-Name: 84fe95d2a5b4d232d657e3b8110027a698a9bcd597f205cc535cfa97bc299f21
Diffstat (limited to 'src/json.c')
-rw-r--r--src/json.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/src/json.c b/src/json.c
index 243afd5dd..81111fff1 100644
--- a/src/json.c
+++ b/src/json.c
@@ -1119,14 +1119,15 @@ static JsonNode *jsonLookupStep(
*pzErr = zPath;
return 0;
}
+ testcase( nKey==0 );
}else{
zKey = zPath;
for(i=0; zPath[i] && zPath[i]!='.' && zPath[i]!='['; i++){}
nKey = i;
- }
- if( nKey==0 ){
- *pzErr = zPath;
- return 0;
+ if( nKey==0 ){
+ *pzErr = zPath;
+ return 0;
+ }
}
j = 1;
for(;;){