1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-09 14:21:03 +03:00

Fix the JSON Path parser so that it will accept zero-length object labels.

[forum/forumpost/c082aeab43|Forum thread c082aeab43].

FossilOrigin-Name: 84fe95d2a5b4d232d657e3b8110027a698a9bcd597f205cc535cfa97bc299f21
This commit is contained in:
drh
2022-04-04 14:24:14 +00:00
parent a81a9f78fd
commit b07fb4f1c2
4 changed files with 30 additions and 12 deletions

View File

@@ -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(;;){