]> git.ipfire.org Git - thirdparty/sqlite.git/commitdiff
Fix a database corruption related crash uncovered by corruptC.test. (CVS 5890)
authordanielk1977 <danielk1977@noemail.net>
Wed, 12 Nov 2008 08:49:51 +0000 (08:49 +0000)
committerdanielk1977 <danielk1977@noemail.net>
Wed, 12 Nov 2008 08:49:51 +0000 (08:49 +0000)
FossilOrigin-Name: 395084acbb4c8ef878d858f640f1ed6be908d175

manifest
manifest.uuid
src/btree.c

index dd8ca3fedffb095f4a9e4193040478b944d8eec8..9b037bea0a5d760979673ec9837c36db591c4b7c 100644 (file)
--- a/manifest
+++ b/manifest
@@ -1,5 +1,5 @@
-C Make\ssure\saffinities\sand\simplicit\scollation\ssequences\sare\scorrectly\sused\sby\scomparison\sexpressions\sin\sthe\sselect-list\sor\shaving\sclause\sof\san\saggregate\squery.\sTicket\s#3493.\s(CVS\s5889)
-D 2008-11-12T08:07:12
+C Fix\sa\sdatabase\scorruption\srelated\scrash\suncovered\sby\scorruptC.test.\s(CVS\s5890)
+D 2008-11-12T08:49:52
 F Makefile.arm-wince-mingw32ce-gcc fcd5e9cd67fe88836360bb4f9ef4cb7f8e2fb5a0
 F Makefile.in 48172b58e444a9725ec482e0c022a564749acab4
 F Makefile.linux-gcc d53183f4aa6a9192d249731c90dbdffbd2c68654
@@ -99,7 +99,7 @@ F src/attach.c 208881c87160d9e2c73a46cf86116c5a6d66f9d7
 F src/auth.c c8b2ab5c8bad4bd90ed7c294694f48269162c627
 F src/bitvec.c 9e922b2577b7e46d8f95349bca6a52f7674d7582
 F src/btmutex.c 3a90096c3080b9057dc570b8e16e46511e1c788a
-F src/btree.c 5406b753fbab8b3ff36cc1378d3f8fe329b667c0
+F src/btree.c 7505a73bd9b7c36a816543c4a71437d8c2f7539a
 F src/btree.h 179c3ea813780df78a289a8f5130db18e6d4616e
 F src/btreeInt.h e38e9b2b285f40f5bc0a6664f630d4a141622f16
 F src/build.c 98a6884d47c3cc12faeb2e9a926018d3a7382133
@@ -656,7 +656,7 @@ F tool/speedtest16.c c8a9c793df96db7e4933f0852abb7a03d48f2e81
 F tool/speedtest2.tcl ee2149167303ba8e95af97873c575c3e0fab58ff
 F tool/speedtest8.c 2902c46588c40b55661e471d7a86e4dd71a18224
 F tool/speedtest8inst1.c 293327bc76823f473684d589a8160bde1f52c14e
-P f8bb34e40917e55696376d2def932a41ad43d0ae
-R 5a5ff0ae69bc01ef9e0f87b7c6714d10
+P b8ceaa00500f29bbbd0cc5aec71a6ffa91ae6b43
+R 80ca606753a89d9ef37cd7a26edcccc0
 U danielk1977
-Z 5729ccf0535d84d7054da6cd16c75bb0
+Z ef9911c8f3e577fc9269a1bb0e2fb7a8
index 349288d7c1c17404784eef6439c5e0bc028c0023..49a4dfdfa1216b6c58c807eb90ad58c11d6db515 100644 (file)
@@ -1 +1 @@
-b8ceaa00500f29bbbd0cc5aec71a6ffa91ae6b43
\ No newline at end of file
+395084acbb4c8ef878d858f640f1ed6be908d175
\ No newline at end of file
index 3c5f9f076afc2d36aac821f469d7eeace1c34234..1dc3f168d18a1cd73b123729fadacb30a7354de5 100644 (file)
@@ -9,7 +9,7 @@
 **    May you share freely, never taking more than you give.
 **
 *************************************************************************
-** $Id: btree.c,v 1.532 2008/11/12 04:55:34 shane Exp $
+** $Id: btree.c,v 1.533 2008/11/12 08:49:52 danielk1977 Exp $
 **
 ** This file implements a external (disk-based) database using BTrees.
 ** See the header comment on "btreeInt.h" for additional information.
@@ -752,6 +752,9 @@ static int defragmentPage(MemPage *pPage){
   data[hdr+7] = 0;
   addr = cellOffset+2*nCell;
   memset(&data[addr], 0, cbrk-addr);
+  if( cbrk-addr!=pPage->nFree ){
+    return SQLITE_CORRUPT_BKPT;
+  }
   return SQLITE_OK;
 }