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

Throw an error on an attempt to open a database where the page

size is larger than SQLITE_MAX_PAGE_SIZE.  Ticket #2628. (CVS 4411)

FossilOrigin-Name: 4881f7cb37e35dcf5da358464ac858a508128e47
This commit is contained in:
drh
2007-09-06 23:39:36 +00:00
parent 334b299462
commit 7dc385ee85
4 changed files with 35 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.423 2007/09/06 22:19:15 drh Exp $
** $Id: btree.c,v 1.424 2007/09/06 23:39:37 drh Exp $
**
** This file implements a external (disk-based) database using BTrees.
** See the header comment on "btreeInt.h" for additional information.
@@ -1647,7 +1647,9 @@ static int lockBtree(BtShared *pBt){
goto page1_init_failed;
}
pageSize = get2byte(&page1[16]);
if( ((pageSize-1)&pageSize)!=0 || pageSize<512 ){
if( ((pageSize-1)&pageSize)!=0 || pageSize<512 ||
(SQLITE_MAX_PAGE_SIZE<32768 && pageSize>SQLITE_MAX_PAGE_SIZE)
){
goto page1_init_failed;
}
assert( (pageSize & 7)==0 );