1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-30 19:03:16 +03:00

Do not allow a comma at the end of a JSON array or object.

FossilOrigin-Name: 7c7a3f3e9bc2f7a7334d8d6eae183d83f22097be
This commit is contained in:
drh
2015-09-23 01:10:29 +00:00
parent 40e0e0dbe7
commit f27cd1f3aa
4 changed files with 22 additions and 10 deletions

View File

@ -606,7 +606,7 @@ static int jsonParseValue(JsonParse *pParse, u32 i){
while( safe_isspace(pParse->zJson[j]) ){ j++; }
x = jsonParseValue(pParse, j);
if( x<0 ){
if( x==(-2) ) return j+1;
if( x==(-2) && pParse->nNode==(u32)iThis+1 ) return j+1;
return -1;
}
if( pParse->oom ) return -1;
@ -636,7 +636,7 @@ static int jsonParseValue(JsonParse *pParse, u32 i){
while( safe_isspace(pParse->zJson[j]) ){ j++; }
x = jsonParseValue(pParse, j);
if( x<0 ){
if( x==(-3) ) return j+1;
if( x==(-3) && pParse->nNode==(u32)iThis+1 ) return j+1;
return -1;
}
j = x;