1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-07-29 08:01:23 +03:00

Ensure that the VFS wrapper in the recover extension does not attempt to invoke undefined methods on the underlying VFS.

FossilOrigin-Name: 347c575108bc8112613a02afda1247bdbed24c15def7eb412d0b27aba047715b
This commit is contained in:
dan
2022-10-27 19:02:51 +00:00
parent 895f12dfe7
commit ac16a4716b
4 changed files with 31 additions and 15 deletions

View File

@ -2498,8 +2498,10 @@ static void recoverInstallWrapper(sqlite3_recover *p){
sqlite3_file_control(p->dbIn, p->zDb, SQLITE_FCNTL_FILE_POINTER, (void*)&pFd);
assert( pFd==0 || pFd->pMethods!=&recover_methods );
if( pFd ){
int iVersion = 1 + (pFd->pMethods->iVersion>1 && pFd->pMethods->xShmMap!=0);
recover_g.pMethods = pFd->pMethods;
recover_g.p = p;
recover_methods.iVersion = iVersion;
pFd->pMethods = &recover_methods;
}
}