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

Check for a failure in the call to sqlite3PagerPagecount() from within

sqlite3PagerWrite().  (Error discovered by valgrind.)

FossilOrigin-Name: d64d181c79aee3501be6f7eb8c11ab2cc9a8d63c
This commit is contained in:
drh
2010-04-02 13:25:22 +00:00
parent a378c566d2
commit 34e2b837d5
3 changed files with 12 additions and 11 deletions

View File

@@ -4322,7 +4322,8 @@ int sqlite3PagerWrite(DbPage *pDbPage){
*/
pg1 = ((pPg->pgno-1) & ~(nPagePerSector-1)) + 1;
sqlite3PagerPagecount(pPager, (int *)&nPageCount);
rc = sqlite3PagerPagecount(pPager, (int *)&nPageCount);
if( rc ) return rc;
if( pPg->pgno>nPageCount ){
nPage = (pPg->pgno - pg1)+1;
}else if( (pg1+nPagePerSector-1)>nPageCount ){