1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-11-14 00:22:38 +03:00

Make sure the %z optimization for printf() is not invoked if there has been

a prior error (SQLITE_NOMEM or SQLITE_TOOBIG) associated with the same
printf() call.

FossilOrigin-Name: a2304a3474b0ca35eee0af64286ce2f7cb24d181323e128d5f04f7fe6e1c0980
This commit is contained in:
drh
2018-09-13 17:07:12 +00:00
parent 396a103612
commit af524a6343
3 changed files with 13 additions and 8 deletions

View File

@@ -686,7 +686,12 @@ void sqlite3_str_vappendf(
if( bufpt==0 ){
bufpt = "";
}else if( xtype==etDYNSTRING ){
if( pAccum->nChar==0 && pAccum->mxAlloc && width==0 && precision<0 ){
if( pAccum->nChar==0
&& pAccum->mxAlloc
&& width==0
&& precision<0
&& pAccum->accError==0
){
/* Special optimization for sqlite3_mprintf("%z..."):
** Extend an existing memory allocation rather than creating
** a new one. */