From ebf0e4dbbdbc5e35f0febe9e6d3bbceffde814c6 Mon Sep 17 00:00:00 2001
From: Dan Kennedy <danielk1977@gmail.com>
Date: Wed, 23 Jan 2019 20:31:56 +0000
Subject: [PATCH 0826/1009] Fix an assert() in vdbemem.c that could fire if the
 database was corrupt.

https://github.com/mackyle/sqlite/commit/ebf0e4dbbdbc5e35f0febe9e6d3bbceffde814c6

---
 src/vdbemem.c      |  2 +-
 1 files changed, 1 insertions(+), 1 deletion(-)

diff --git a/src/vdbemem.c b/src/vdbemem.c
index db8fedd..8493df7 100644
--- a/src/vdbemem.c
+++ b/src/vdbemem.c
@@ -243,7 +243,7 @@ SQLITE_NOINLINE int sqlite3VdbeMemGrow(Mem *pMem, int n, int bPreserve){
 ** if unable to complete the resizing.
 */
 int sqlite3VdbeMemClearAndResize(Mem *pMem, int szNew){
-  assert( szNew>0 );
+  assert( CORRUPT_DB || szNew>0 );
   assert( (pMem->flags & MEM_Dyn)==0 || pMem->szMalloc==0 );
   if( pMem->szMalloc<szNew ){
     return sqlite3VdbeMemGrow(pMem, szNew, 0);
-- 
1.8.3.1

