/ Check-in [02828d71]
Login

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

Overview
Comment:Prevent a possible crash when trying to recover using a carefully corrupted \ and truncated rollback journal. (Test case in TH3)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 02828d717e2d97b1f59e9279cea9c06eed4accd4e262606bd90d060449c5a1a3
User & Date: drh 2017-09-07 09:56:37
Context
2017-09-08
17:48
Have the header comment for sqlite3Checkpoint() mention TRUNCATE along with the other three checkpoint types. No changes to code. check-in: e1e3ca7e user: dan tags: trunk
2017-09-07
09:56
Prevent a possible crash when trying to recover using a carefully corrupted \ and truncated rollback journal. (Test case in TH3) check-in: 02828d71 user: drh tags: trunk
2017-09-05
20:16
Update "PRAGMA integrity_check" to detect inconsistencies between a single record's header and body. check-in: 9e393a0e user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/pager.c.

  1311   1311     unsigned char aMagic[8];   /* A buffer to hold the magic header */
  1312   1312     zMaster[0] = '\0';
  1313   1313   
  1314   1314     if( SQLITE_OK!=(rc = sqlite3OsFileSize(pJrnl, &szJ))
  1315   1315      || szJ<16
  1316   1316      || SQLITE_OK!=(rc = read32bits(pJrnl, szJ-16, &len))
  1317   1317      || len>=nMaster 
         1318  +   || len>szJ-16
  1318   1319      || len==0 
  1319   1320      || SQLITE_OK!=(rc = read32bits(pJrnl, szJ-12, &cksum))
  1320   1321      || SQLITE_OK!=(rc = sqlite3OsRead(pJrnl, aMagic, 8, szJ-8))
  1321   1322      || memcmp(aMagic, aJournalMagic, 8)
  1322   1323      || SQLITE_OK!=(rc = sqlite3OsRead(pJrnl, zMaster, len, szJ-16-len))
  1323   1324     ){
  1324   1325       return rc;