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

Fix a couple instances of OOM handling in the json extension.

FossilOrigin-Name: 213a6c5ccbcfe4495d45e3608e99a6398751aeed
This commit is contained in:
drh
2015-08-22 03:05:54 +00:00
parent 38978dd4ed
commit be9474ee05
3 changed files with 9 additions and 8 deletions

View File

@ -587,6 +587,7 @@ static int jsonParseValue(JsonParse *pParse, u32 i){
if( x==(-2) && pParse->nNode==iThis+1 ) return j+1;
return -1;
}
if( pParse->oom ) return -1;
if( pParse->aNode[pParse->nNode-1].eType!=JSON_STRING ) return -1;
j = x;
while( isspace(pParse->zJson[j]) ){ j++; }
@ -639,7 +640,7 @@ static int jsonParseValue(JsonParse *pParse, u32 i){
j++;
}
jsonParseAddNode(pParse, JSON_STRING, j+1-i, &pParse->zJson[i]);
pParse->aNode[pParse->nNode-1].jnFlags = jnFlags;
if( !pParse->oom ) pParse->aNode[pParse->nNode-1].jnFlags = jnFlags;
return j+1;
}else if( c=='n'
&& strncmp(pParse->zJson+i,"null",4)==0