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

Fix two instances where a malformed header in a database file (in other words

a corrupt database file) can lead to an assertion fault. (CVS 6712)

FossilOrigin-Name: 4e92c7f20afa51849128aa1d784ab885b517a73d
This commit is contained in:
drh
2009-06-04 00:11:56 +00:00
parent 69e931e7bb
commit c5e47ac238
4 changed files with 15 additions and 11 deletions

View File

@@ -9,7 +9,7 @@
** May you share freely, never taking more than you give.
**
*************************************************************************
** $Id: btree.c,v 1.612 2009/06/03 21:04:36 drh Exp $
** $Id: btree.c,v 1.613 2009/06/04 00:11:56 drh Exp $
**
** This file implements a external (disk-based) database using BTrees.
** See the header comment on "btreeInt.h" for additional information.
@@ -2686,6 +2686,7 @@ static int autoVacuumCommit(BtShared *pBt){
while( PTRMAP_ISPAGE(pBt, nFin) || nFin==PENDING_BYTE_PAGE(pBt) ){
nFin--;
}
if( nFin>nOrig ) return SQLITE_CORRUPT_BKPT;
for(iFree=nOrig; iFree>nFin && rc==SQLITE_OK; iFree--){
rc = incrVacuumStep(pBt, nFin, iFree);