diff options
author | drh <> | 2023-11-26 00:56:40 +0000 |
---|---|---|
committer | drh <> | 2023-11-26 00:56:40 +0000 |
commit | 15c0b03c5dcccd8a5c3282b7b961dbfc9fda7760 (patch) | |
tree | ae938dd2b204f5a9b208168a54b6b00643b988d2 /src/json.c | |
parent | 50b37832b250acb3fc55b8f177935ab7af4eef48 (diff) | |
download | sqlite-15c0b03c5dcccd8a5c3282b7b961dbfc9fda7760.tar.gz sqlite-15c0b03c5dcccd8a5c3282b7b961dbfc9fda7760.zip |
Fix corner-case error conditions.
FossilOrigin-Name: ec23d34ab75e1d7e9366e59c633e0d30def8759f6d4717583ebeb4c90aeccf0d
Diffstat (limited to 'src/json.c')
-rw-r--r-- | src/json.c | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/src/json.c b/src/json.c index 14fe27414..931760826 100644 --- a/src/json.c +++ b/src/json.c @@ -416,7 +416,7 @@ static void jsonStringReset(JsonString *p){ */ static void jsonStringOom(JsonString *p){ p->eErr |= JSTRING_OOM; - sqlite3_result_error_nomem(p->pCtx); + if( p->pCtx ) sqlite3_result_error_nomem(p->pCtx); jsonStringReset(p); } @@ -5766,8 +5766,7 @@ static int jsonEachNext(sqlite3_vtab_cursor *cur){ n = jsonbPayloadSize(&p->sParse, i, &sz); p->i = i + n + sz; } - if( p->eType==JSONB_ARRAY ){ - assert( p->nParent>0 ); + if( p->eType==JSONB_ARRAY && p->nParent ){ p->aParent[p->nParent-1].iKey++; } p->iRowid++; @@ -5809,7 +5808,6 @@ static int jsonEachColumn( case JEACH_KEY: { if( p->nParent==0 ){ u32 n, j; - assert( p->iRowid==0 && p->bRecursive ); if( p->nRoot==1 ) break; j = jsonEachPathLength(p); n = p->nRoot - j; |