From c5e47c0d3f7abfe24837e48e38072ae02bbaf53b Mon Sep 17 00:00:00 2001 From: Dan Kennedy Date: Wed, 13 Jun 2018 11:11:13 +0000 Subject: [PATCH] Check that malloc() has not already failed when invoking the xUpdate() method of a virtual table implementation. This fixes an assert() failure in FTS5 that could occur following an OOM condition. --- src/vdbe.c | 1 + test/releasetest.tcl | 1 + 2 files changed, 2 insertions(+) diff --git a/src/vdbe.c b/src/vdbe.c index 6cdfadb563..823b034815 100644 --- a/src/vdbe.c +++ b/src/vdbe.c @@ -6999,6 +6999,7 @@ case OP_VUpdate: { || pOp->p5==OE_Abort || pOp->p5==OE_Ignore || pOp->p5==OE_Replace ); assert( p->readOnly==0 ); + if( db->mallocFailed ) goto no_mem; sqlite3VdbeIncrWriteCounter(p, 0); pVtab = pOp->p4.pVtab->pVtab; if( pVtab==0 || NEVER(pVtab->pModule==0) ){ diff --git a/test/releasetest.tcl b/test/releasetest.tcl index 01a0795bfa..65f6dadad9 100755 --- a/test/releasetest.tcl +++ b/test/releasetest.tcl @@ -127,6 +127,7 @@ array set ::Configs [strip_comments { -DSQLITE_ENABLE_HIDDEN_COLUMNS -DSQLITE_MAX_ATTACHED=125 -DSQLITE_MUTATION_TEST + --enable-fts5 --enable-json1 } "Fast-One" { -O6 -- 2.11.4.GIT