1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Correctly detect an OOM occurring in the setDestPgsz() subroutine of

backup.

FossilOrigin-Name: d9d8a048d4b621435870b4f8dd13b2938ac2f8fd
This commit is contained in:
drh
2016-09-02 21:17:51 +00:00
parent 033564cca9
commit 76729ed4be
3 changed files with 11 additions and 9 deletions

View File

@@ -398,7 +398,9 @@ int sqlite3_backup_step(sqlite3_backup *p, int nPage){
** is especially important on ZipVFS systems, as in that case it is
** not possible to create a database file that uses one page size by
** writing to it with another. */
if( p->bDestLocked==0 ) setDestPgsz(p);
if( p->bDestLocked==0 && rc==SQLITE_OK && setDestPgsz(p)==SQLITE_NOMEM ){
rc = SQLITE_NOMEM;
}
/* Lock the destination database, if it is not locked already. */
if( SQLITE_OK==rc && p->bDestLocked==0