/ Check-in [4d41ca7d]
Login

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

Overview
Comment:Always check for reads past the end of the file on the in-memory journal driver. This used to be an assert().
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 4d41ca7d6efbdac70890a8d4159488fc7f59bf78a550b00597b4df990c4fcaef
User & Date: drh 2019-08-14 15:17:21
Context
2019-08-15
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
2019-08-13
20:34
Add some static to the 'regexp' extension. check-in: a21d1dde user: mistachkin tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/memjournal.c.

    92     92   ){
    93     93     MemJournal *p = (MemJournal *)pJfd;
    94     94     u8 *zOut = zBuf;
    95     95     int nRead = iAmt;
    96     96     int iChunkOffset;
    97     97     FileChunk *pChunk;
    98     98   
    99         -#if defined(SQLITE_ENABLE_ATOMIC_WRITE) \
   100         - || defined(SQLITE_ENABLE_BATCH_ATOMIC_WRITE)
   101     99     if( (iAmt+iOfst)>p->endpoint.iOffset ){
   102    100       return SQLITE_IOERR_SHORT_READ;
   103    101     }
   104         -#endif
   105         -
   106         -  assert( (iAmt+iOfst)<=p->endpoint.iOffset );
   107    102     assert( p->readpoint.iOffset==0 || p->readpoint.pChunk!=0 );
   108    103     if( p->readpoint.iOffset!=iOfst || iOfst==0 ){
   109    104       sqlite3_int64 iOff = 0;
   110    105       for(pChunk=p->pFirst; 
   111    106           ALWAYS(pChunk) && (iOff+p->nChunkSize)<=iOfst;
   112    107           pChunk=pChunk->pNext
   113    108       ){