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

Fix a potential NULL-pointer dereference in btreeSwapOutMmap().

FossilOrigin-Name: e81ccdcd87a1387f7ca08d4d7c899311e2180d32
This commit is contained in:
drh
2013-03-22 19:56:27 +00:00
parent aa1d67b1d9
commit 23f29ec628
3 changed files with 9 additions and 9 deletions

View File

@@ -2593,7 +2593,7 @@ static int btreeSwapOutMmap(BtShared *pBt){
for(pCsr=pBt->pCursor; pCsr && rc==SQLITE_OK; pCsr=pCsr->pNext){
if( pCsr->iPage>=0 ){
MemPage *pPg = pCsr->apPage[0];
if( pPg->pDbPage->flags & PGHDR_MMAP ){
if( pPg && pPg->pDbPage->flags & PGHDR_MMAP ){
MemPage *pNew = 0;
rc = getAndInitPage(pBt, pPg->pgno, &pNew, 0);
if( rc==SQLITE_OK && pCsr->iPage==0 ){