From: drh <> Date: Wed, 3 May 2023 06:48:08 +0000 (+0000) Subject: If the page size is wrong on the page1 content inside a WAL file, then X-Git-Tag: version-3.42.0~55 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ce2aa8bebe7398d96358715b5004fef3fd2b66f3;p=thirdparty%2Fsqlite.git If the page size is wrong on the page1 content inside a WAL file, then running VACUUM could trigger an assert(). This check-in changes that assert() into a branch that returns SQLITE_CORRUPT. [forum:/info/4ef9b37d74d2d2e8|Forum post 4ef9b37d74d2d2e8] FossilOrigin-Name: 0512f82a2cde7447cb348d9fd620f39f2f0e359141903cde20f7ba30b5d34af3 --- diff --git a/manifest b/manifest index 7fbb70d9a1..2d1e258bf3 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Improved\sdetection\sof\sexcess\srecursion\son\sarrays\sand\sobjects\sin\sthe\sJSON\nparser.\s\sFixes\sa\sproblem\sdetected\sby\sdbsqlfuzz. -D 2023-05-03T06:38:03.879 +C If\sthe\spage\ssize\sis\swrong\son\sthe\spage1\scontent\sinside\sa\sWAL\sfile,\sthen\nrunning\sVACUUM\scould\strigger\san\sassert().\s\sThis\scheck-in\schanges\sthat\sassert()\ninto\sa\sbranch\sthat\sreturns\sSQLITE_CORRUPT.\n[forum:/info/4ef9b37d74d2d2e8|Forum\spost\s4ef9b37d74d2d2e8] +D 2023-05-03T06:48:08.354 F .fossil-settings/empty-dirs dbb81e8fc0401ac46a1491ab34a7f2c7c0452f2f06b54ebb845d024ca8283ef1 F .fossil-settings/ignore-glob 35175cdfcf539b2318cb04a9901442804be81cd677d8b889fcc9149c21f239ea F LICENSE.md df5091916dbb40e6e9686186587125e1b2ff51f022cc334e886c19a0e9982724 @@ -717,7 +717,7 @@ F src/vdbetrace.c fe0bc29ebd4e02c8bc5c1945f1d2e6be5927ec12c06d89b03ef2a4def34bf8 F src/vdbevtab.c aae4bd769410eb7e1d02c42613eec961d514459b1c3c1c63cfc84e92a137daac F src/vtab.c 4a1b231b5938de0282fbb605eb068ca673a1b6a383130f54d1bcbbac951988ad F src/vxworks.h d2988f4e5a61a4dfe82c6524dd3d6e4f2ce3cdb9 -F src/wal.c 3f4ac276a60bda76f9f1f6f1c2c38599bacd4987e5efcd3f7fed2647bf97280a +F src/wal.c 6a2bba81139f12189d4fc60f30ff5147581328c2cefc99eb809017ab90c08dff F src/wal.h c3aa7825bfa2fe0d85bef2db94655f99870a285778baa36307c0a16da32b226a F src/walker.c f890a3298418d7cba3b69b8803594fdc484ea241206a8dfa99db6dd36f8cbb3b F src/where.c f69d94f34e1c523cd9b66041e4afe015cad29888617f3c09a2a5bc36018917d0 @@ -2068,8 +2068,8 @@ F vsixtest/vsixtest.tcl 6a9a6ab600c25a91a7acc6293828957a386a8a93 F vsixtest/vsixtest.vcxproj.data 2ed517e100c66dc455b492e1a33350c1b20fbcdc F vsixtest/vsixtest.vcxproj.filters 37e51ffedcdb064aad6ff33b6148725226cd608e F vsixtest/vsixtest_TemporaryKey.pfx e5b1b036facdb453873e7084e1cae9102ccc67a0 -P 9350a25ac0b55a6b901bc50e4db6d4e883c2617e1d2a8fdc90effabe52bb0012 -R 45a463b95a50344e49894bd782f939f9 +P d40fd5924adaa8d6b1dd6b9a4087f64d496cf60096ae11c9229c59309c0d4844 +R 826fae3d34ead7c2ffb03c3b65d82a91 U drh -Z e8683fa9e2b198eeacdd4ef8add8ddad +Z 66e9580a8736455dc37accdb5840cb3e # Remove this line to create a well-formed Fossil manifest. diff --git a/manifest.uuid b/manifest.uuid index bb81c544f8..af1af7ecb7 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -d40fd5924adaa8d6b1dd6b9a4087f64d496cf60096ae11c9229c59309c0d4844 \ No newline at end of file +0512f82a2cde7447cb348d9fd620f39f2f0e359141903cde20f7ba30b5d34af3 \ No newline at end of file diff --git a/src/wal.c b/src/wal.c index 43bae13e04..7e349a7895 100644 --- a/src/wal.c +++ b/src/wal.c @@ -3710,7 +3710,7 @@ int sqlite3WalFrames( if( rc ) return rc; } } - assert( (int)pWal->szPage==szPage ); + if( (int)pWal->szPage!=szPage ) return SQLITE_CORRUPT_BKPT; /* Setup information needed to write frames into the WAL */ w.pWal = pWal;