/ Check-in [9191ff67]
Login

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

Overview
Comment:Fix a slightly incorrect corruption detection branch in the btree logic.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 9191ff670cb7f36e0b2dac4a22888679b639845687aef8edcc3c05e35ba71eda
User & Date: drh 2018-05-05 01:23:28
Context
2018-05-05
16:50
In an ORDER BY LIMIT, make sure the ORDER BY expression evaluator does not try to reuse values from the result set if the result set has not yet be computed. This fixes a bug in the recent deferred-row loading optimization, check-in [c381f0ea57002a264fd958b28e]. OSSFuzz discovered the problem. check-in: 5d61e75f user: drh tags: trunk
01:23
Fix a slightly incorrect corruption detection branch in the btree logic. check-in: 9191ff67 user: drh tags: trunk
2018-05-04
18:32
Fix requirements marks. No code changes. check-in: 7fdad122 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Show Whitespace Changes Patch

Changes to src/btree.c.

  6222   6222     u32 ovflPageSize;
  6223   6223   
  6224   6224     assert( sqlite3_mutex_held(pPage->pBt->mutex) );
  6225   6225     pPage->xParseCell(pPage, pCell, pInfo);
  6226   6226     if( pInfo->nLocal==pInfo->nPayload ){
  6227   6227       return SQLITE_OK;  /* No overflow pages. Return without doing anything */
  6228   6228     }
  6229         -  if( pCell+pInfo->nSize-1 > pPage->aData+pPage->maskPage ){
         6229  +  testcase( pCell + pInfo->nSize == pPage->aDataEnd );
         6230  +  testcase( pCell + (pInfo->nSize-1) == pPage->aDataEnd );
         6231  +  if( pCell + pInfo->nSize > pPage->aDataEnd ){
  6230   6232       /* Cell extends past end of page */
  6231   6233       return SQLITE_CORRUPT_PAGE(pPage);
  6232   6234     }
  6233   6235     ovflPgno = get4byte(pCell + pInfo->nSize - 4);
  6234   6236     pBt = pPage->pBt;
  6235   6237     assert( pBt->usableSize > 4 );
  6236   6238     ovflPageSize = pBt->usableSize - 4;