From: drh Date: Fri, 22 May 2015 23:39:29 +0000 (+0000) Subject: Fix another bad assert() in btree - one that can be false on a corrupt database X-Git-Tag: version-3.8.11~237 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=cea1dc279848f308d85ea34517fca2566861e40f;p=thirdparty%2Fsqlite.git Fix another bad assert() in btree - one that can be false on a corrupt database file. FossilOrigin-Name: 89f0bbfde4d86a7b15e93aab9c487b4355c6fb2d --- diff --git a/manifest b/manifest index cc487cf384..c7cda0512f 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Fix\sincorrect\svalidation\sof\sthe\ssize\sof\sthe\sBLOB\sreturned\sby\sa\sgeometry\nfunction\son\sthe\sRHS\sof\sa\sMATCH\soperator\sin\sRTree.\s\sThe\sold\scode\sworked\sfor\n64-bit\ssystems\s(by\schance)\sbut\sfails\son\s32-bit. -D 2015-05-22T23:17:28.381 +C Fix\sanother\sbad\sassert()\sin\sbtree\s-\sone\sthat\scan\sbe\sfalse\son\sa\scorrupt\sdatabase\nfile. +D 2015-05-22T23:39:29.128 F Makefile.arm-wince-mingw32ce-gcc d6df77f1f48d690bd73162294bbba7f59507c72f F Makefile.in 0a6ae26396ec696221021780dffbb894ff3cead7 F Makefile.linux-gcc 91d710bdc4998cb015f39edf3cb314ec4f4d7e23 @@ -192,7 +192,7 @@ F src/auth.c b56c78ebe40a2110fd361379f7e8162d23f92240 F src/backup.c ff743689c4d6c5cb55ad42ed9d174b2b3e71f1e3 F src/bitvec.c 5eb7958c3bf65210211cbcfc44eff86d0ded7c9d F src/btmutex.c 45a968cc85afed9b5e6cf55bf1f42f8d18107f79 -F src/btree.c 0eb4eb39e75be6170f1e59f7d6aabedaefb19938 +F src/btree.c d2bf38cf256bd2fcaa9ed87f2f217167d849fc1b F src/btree.h 969adc948e89e449220ff0ff724c94bb2a52e9f1 F src/btreeInt.h 973a22a6fd61350b454ad614832b1f0a5e25a1e4 F src/build.c d5d9090788118178190c5724c19f93953b8c7a4e @@ -1278,7 +1278,7 @@ F tool/vdbe_profile.tcl 67746953071a9f8f2f668b73fe899074e2c6d8c1 F tool/warnings-clang.sh f6aa929dc20ef1f856af04a730772f59283631d4 F tool/warnings.sh 0abfd78ceb09b7f7c27c688c8e3fe93268a13b32 F tool/win/sqlite.vsix deb315d026cc8400325c5863eef847784a219a2f -P c1814242e6ce035d486cfbad5a1f4b49aa8898f3 -R f01355780527736c645fe9d48d526152 +P 10cc44f5a63e6cadf6940bb7310a177ee7fa6ee2 +R 12583c8a4670388a5d60502757678b98 U drh -Z c568275ed97c21c4c01709075e3bc4ce +Z f1e1ea5567a0f5557363801842b88558 diff --git a/manifest.uuid b/manifest.uuid index 5d4569be1b..850b0dbfaf 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -10cc44f5a63e6cadf6940bb7310a177ee7fa6ee2 \ No newline at end of file +89f0bbfde4d86a7b15e93aab9c487b4355c6fb2d \ No newline at end of file diff --git a/src/btree.c b/src/btree.c index 6b7da394ac..01ce974d75 100644 --- a/src/btree.c +++ b/src/btree.c @@ -6167,7 +6167,8 @@ static void rebuildPage( memcpy(pData, pCell, szCell[i]); put2byte(pCellptr, (pData - aData)); pCellptr += 2; - assert( szCell[i]==cellSizePtr(pPg, pCell) ); + assert( szCell[i]==cellSizePtr(pPg, pCell) || CORRUPT_DB ); + testcase( szCell[i]!=cellSizePtr(pPg,pCell) ); } /* The pPg->nFree field is now set incorrectly. The caller will fix it. */