From: drh Date: Sat, 23 May 2015 19:29:08 +0000 (+0000) Subject: Earlier detection of a specific kind of corruption in the balance_nonroot() X-Git-Tag: version-3.8.11~233 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3183ac590de8bfcee9eb9bbc89149f25755f9c03;p=thirdparty%2Fsqlite.git Earlier detection of a specific kind of corruption in the balance_nonroot() routine. FossilOrigin-Name: ee6dc9913a8733891576e6e298241f7440209c5e --- diff --git a/manifest b/manifest index 8956df4e64..f0b235a933 100644 --- a/manifest +++ b/manifest @@ -1,5 +1,5 @@ -C Minor\sdocumentation\simprovements.\s\sNo\schanges\sto\scode. -D 2015-05-23T02:44:00.021 +C Earlier\sdetection\sof\sa\sspecific\skind\sof\scorruption\sin\sthe\sbalance_nonroot()\nroutine. +D 2015-05-23T19:29:08.948 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 d2bf38cf256bd2fcaa9ed87f2f217167d849fc1b +F src/btree.c c40b84835216d0f4c85889b3b86648b375936528 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 c404fcace83613a50015f15097b7f28123c221c3 -R aea65554b1ff9d1de4bd129eeec24691 +P e446d9ce0049b8ce0fd4f03205a0c32776fc76cd +R adb5597802e2180b564cf04263c0d643 U drh -Z b24694de2ad87d8d1cd289eb9cfaf505 +Z 0cf4cd65645d8faec0ee2a47a85adb56 diff --git a/manifest.uuid b/manifest.uuid index 6ea25ad158..97a87ce5d4 100644 --- a/manifest.uuid +++ b/manifest.uuid @@ -1 +1 @@ -e446d9ce0049b8ce0fd4f03205a0c32776fc76cd \ No newline at end of file +ee6dc9913a8733891576e6e298241f7440209c5e \ No newline at end of file diff --git a/src/btree.c b/src/btree.c index 01ce974d75..6ce6a17635 100644 --- a/src/btree.c +++ b/src/btree.c @@ -6879,6 +6879,10 @@ static int balance_nonroot( apCell[nCell] = pTemp+leafCorrection; assert( leafCorrection==0 || leafCorrection==4 ); szCell[nCell] = szCell[nCell] - leafCorrection; + if( szCell[nCell]<3 ){ + rc = SQLITE_CORRUPT_BKPT; + goto balance_cleanup; + } if( !pOld->leaf ){ assert( leafCorrection==0 ); assert( pOld->hdrOffset==0 );