Skip to content

Commit e1624c6

Browse files
committed
fix short read detection
1 parent 828ef53 commit e1624c6

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

src/SQLiteNestedVFS.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -480,6 +480,7 @@ class InnerDatabaseFile : public SQLiteVFS::File {
480480
// calculate page number range
481481
sqlite3_int64 first_page = 1 + iOfst / page_size_,
482482
last_page = first_page + (iAmt - 1) / page_size_;
483+
last_page = std::min(last_page, (sqlite3_int64)DetectPageCount());
483484
int sofar = 0;
484485
std::vector<char> pagebuf;
485486

0 commit comments

Comments
 (0)