diff options
Diffstat (limited to 'src/json.c')
-rw-r--r-- | src/json.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/json.c b/src/json.c index 1a4ce3af1..3aa4b4e50 100644 --- a/src/json.c +++ b/src/json.c @@ -1623,6 +1623,7 @@ json_parse_restart: case '[': { /* Parse array */ iThis = pParse->nBlob; + assert( i<=pParse->nJson ); jsonBlobAppendNode(pParse, JSONB_ARRAY, pParse->nJson - i, 0); iStart = pParse->nBlob; if( pParse->oom ) return -1; @@ -2027,6 +2028,10 @@ static void jsonReturnStringAsBlob(JsonString *pStr){ JsonParse px; memset(&px, 0, sizeof(px)); jsonStringTerminate(pStr); + if( pStr->eErr ){ + sqlite3_result_error_nomem(pStr->pCtx); + return; + } px.zJson = pStr->zBuf; px.nJson = pStr->nUsed; px.db = sqlite3_context_db_handle(pStr->pCtx); |