/ Check-in [b517a52f]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Early detection out-of-bounds page numbers on the direct-overflow-read optimization gives consistent error messages regardless of whether or not the optimization is enabled.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: b517a52fa36df0a0854a75858b5e81861771d2e9032a5a0ad79aa76ae64130a2
User & Date: drh 2019-08-15 00:04:44
Context
2019-08-15
13:17
Ensure that the cell overwrite optimization does not overwrite the header of the b-tree page. check-in: 4cc5694c user: drh tags: trunk
00:04
Early detection out-of-bounds page numbers on the direct-overflow-read optimization gives consistent error messages regardless of whether or not the optimization is enabled. check-in: b517a52f user: drh tags: trunk
2019-08-14
15:17
Always check for reads past the end of the file on the in-memory journal driver. This used to be an assert(). check-in: 4d41ca7d user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/btree.c.

  4875   4875           ){
  4876   4876             sqlite3_file *fd = sqlite3PagerFile(pBt->pPager);
  4877   4877             u8 aSave[4];
  4878   4878             u8 *aWrite = &pBuf[-4];
  4879   4879             assert( aWrite>=pBufStart );                         /* due to (6) */
  4880   4880             memcpy(aSave, aWrite, 4);
  4881   4881             rc = sqlite3OsRead(fd, aWrite, a+4, (i64)pBt->pageSize*(nextPage-1));
         4882  +          if( rc && nextPage>pBt->nPage ) rc = SQLITE_CORRUPT_BKPT;
  4882   4883             nextPage = get4byte(aWrite);
  4883   4884             memcpy(aWrite, aSave, 4);
  4884   4885           }else
  4885   4886   #endif
  4886   4887   
  4887   4888           {
  4888   4889             DbPage *pDbPage;