mirror of
https://github.com/sqlite/sqlite.git
synced 2025-08-07 02:42:48 +03:00
Bug fix: Only trust the database size number at offset 28 if the change
counter at offset 24 matches the version number counter at offset 92. This prevents corruption in the case of two applications writing to the database where one is an older version of SQLite and the other is a newer version. FossilOrigin-Name: f80c3f922a114e738613955a939db46cf0847038
This commit is contained in:
@@ -2250,7 +2250,7 @@ static int lockBtree(BtShared *pBt){
|
||||
if( (rc = sqlite3PagerPagecount(pBt->pPager, &nPageFile))!=SQLITE_OK ){;
|
||||
goto page1_init_failed;
|
||||
}
|
||||
if( nPage==0 ){
|
||||
if( nPage==0 || memcmp(24+(u8*)pPage1->aData, 92+(u8*)pPage1->aData,4)!=0 ){
|
||||
nPage = nPageFile;
|
||||
}
|
||||
if( nPage>0 ){
|
||||
|
Reference in New Issue
Block a user