diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/vdbemem.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/vdbemem.c b/src/vdbemem.c index 1052bb2f6..0f5117dad 100644 --- a/src/vdbemem.c +++ b/src/vdbemem.c @@ -322,7 +322,10 @@ int sqlite3VdbeMemClearAndResize(Mem *pMem, int szNew){ ** this routine is a no-op. */ void sqlite3VdbeMemZeroTerminateIfAble(Mem *pMem){ - if( (pMem->flags & (MEM_Str|MEM_Term|MEM_Ephem))!=MEM_Str ) return; + if( (pMem->flags & (MEM_Str|MEM_Term|MEM_Ephem|MEM_Static))!=MEM_Str ){ + /* pMem must be a string, and it cannot be an ephemeral or static string */ + return; + } if( pMem->enc!=SQLITE_UTF8 ) return; if( NEVER(pMem->z==0) ) return; if( pMem->flags & MEM_Dyn ){ |