1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-07 02:42:48 +03:00

Fix a database corruption related crash uncovered by corruptC.test. (CVS 5890)

FossilOrigin-Name: 395084acbb4c8ef878d858f640f1ed6be908d175
This commit is contained in:
danielk1977
2008-11-12 08:49:51 +00:00
parent 259a455f71
commit 360e634ed4
3 changed files with 11 additions and 8 deletions

View 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;
}