From: drh Date: Fri, 2 Sep 2016 21:17:51 +0000 (+0000) Subject: Correctly detect an OOM occurring in the setDestPgsz() subroutine of X-Git-Tag: version-3.15.0~116 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=76729ed4be600448eac38af45aafacdff116500f;p=thirdparty%2Fsqlite.git Correctly detect an OOM occurring in the setDestPgsz() subroutine of backup. FossilOrigin-Name: d9d8a048d4b621435870b4f8dd13b2938ac2f8fd --- diff --git a/manifest b/manifest index f6d9f3788a..4b8ebb6ca8 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Within\sa\sbackup\soperation,\sensure\sthat\sa\sread-transaction\sis\sopened\son\sthe\ssource\sdatabase\sbefore\sits\spage\ssize\sis\sread.\sThis\sensures\sthe\spage-size\sused\sto\swrite\sto\sthe\sbackup\sdatabase\sis\sthe\ssame\sas\sits\sactual\spage-size,\swhich\sis\simportant\sfor\sZipVFS\sdatabases. -D 2016-09-02T17:18:20.100 +C Correctly\sdetect\san\sOOM\soccurring\sin\sthe\ssetDestPgsz()\ssubroutine\sof\nbackup. +D 2016-09-02T21:17:51.499 F Makefile.in cfd8fb987cd7a6af046daa87daa146d5aad0e088 F Makefile.linux-gcc 7bc79876b875010e8c8f9502eb935ca92aa3c434 F Makefile.msc 5017381e4853b1472e01d5bb926be1268eba429c @@ -325,7 +325,7 @@ F src/alter.c 299117695b1f21ac62dfc5b608588810ba22ed0d F src/analyze.c 8b62b2cf4da85451534ac0af82cafc418d837f68 F src/attach.c 4711ff365df4072b8c3dcd55db5d12dcf8ffa0c6 F src/auth.c 930b376a9c56998557367e6f7f8aaeac82a2a792 -F src/backup.c 7d986927896b70c29a313b9954ab36576aff113d +F src/backup.c 92c2e3b5fcb47626413717138617f4d32f08aea4 F src/bitvec.c 3ee4c8b2c94ed3a7377256e18199e6ff5cf33f63 F src/btmutex.c bc87dd3b062cc26edfe79918de2200ccb8d41e73 F src/btree.c 2551bd3ecb8b8988fb8b23aabadfb214dbc38e46 @@ -1511,7 +1511,7 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P f4ba894a86aa195bcbe2fa69e91cd870ec3fb577 -R 6268e0964e35cc05a56dd4669fe54aba -U dan -Z 246b0cb12b0fcdaba66d59db5334a074 +P 7908fc604991d81140c182b97981fd724ad126ae +R 927ab162f03d57784d15e59a76583f84 +U drh +Z 3a29e1d29c21b4d8169c8797b79e666a diff --git a/manifest.uuid b/manifest.uuid index a145bb5aba..a3366a05c1 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -7908fc604991d81140c182b97981fd724ad126ae \ No newline at end of file +d9d8a048d4b621435870b4f8dd13b2938ac2f8fd \ No newline at end of file diff --git a/src/backup.c b/src/backup.c index 0a236700b2..eb8f15cc7e 100644 --- a/src/backup.c +++ b/src/backup.c @@ -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