mirror of
https://github.com/sqlite/sqlite.git
synced 2025-11-09 14:21:03 +03:00
Fix problems following OOM in JSONB parsing.
FossilOrigin-Name: 0d8cd6b5fb592f88f593ceaad9cdfa95dcfdf14169c3a56a5becbd66d62fd02b
This commit is contained in:
12
src/json.c
12
src/json.c
@@ -1612,7 +1612,9 @@ json_parse_restart:
|
||||
pParse->iErr = j;
|
||||
return -1;
|
||||
}
|
||||
pParse->aNode[iThis].n = pParse->nNode - (u32)iThis - 1;
|
||||
if( !pParse->oom ){
|
||||
pParse->aNode[iThis].n = pParse->nNode - (u32)iThis - 1;
|
||||
}
|
||||
pParse->iDepth--;
|
||||
return j+1;
|
||||
}
|
||||
@@ -3493,7 +3495,9 @@ static int jsonParseValueFromBlob(JsonParse *pParse, u32 i){
|
||||
if( r<=0 ) return -1;
|
||||
j = (u32)r;
|
||||
}
|
||||
pParse->aNode[iThis].n = pParse->nNode - (u32)iThis - 1;
|
||||
if( !pParse->oom ){
|
||||
pParse->aNode[iThis].n = pParse->nNode - (u32)iThis - 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
case JSONB_OBJECT: {
|
||||
@@ -3507,7 +3511,9 @@ static int jsonParseValueFromBlob(JsonParse *pParse, u32 i){
|
||||
}
|
||||
j = (u32)r;
|
||||
}
|
||||
pParse->aNode[iThis].n = pParse->nNode - (u32)iThis - 1;
|
||||
if( !pParse->oom ){
|
||||
pParse->aNode[iThis].n = pParse->nNode - (u32)iThis - 1;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user