1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-05 15:55:57 +03:00

Fix a potential null-pointer deference following OOM introduced by

check-in [e39795d7] (unreleased).

FossilOrigin-Name: a2f77285fa44df86863eed576271f1030ec60f15480daf175908c5082c27774b
This commit is contained in:
drh
2017-06-11 18:26:15 +00:00
parent c097b309aa
commit c62aab5ba8
3 changed files with 8 additions and 8 deletions

View File

@@ -5716,7 +5716,7 @@ static int allocateBtreePage(
}
testcase( iTrunk==mxPage );
if( iTrunk>mxPage || nSearch++ > n ){
rc = SQLITE_CORRUPT_PGNO(pPrevTrunk->pgno);
rc = SQLITE_CORRUPT_PGNO(pPrevTrunk ? pPrevTrunk->pgno : 1);
}else{
rc = btreeGetUnusedPage(pBt, iTrunk, &pTrunk, 0);
}