/ Check-in [c4f0568f]
Login

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

Overview
Comment:Detect zero-length free slots on btree pages and report that as corruption.
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: c4f0568fde1d4070e7522ec36c0958be7426076002a7fa2da12a46411ab2e92d
User & Date: drh 2019-03-13 10:29:16
Context
2019-03-13
11:40
When deserializing a database (sqlite3_deserialize()), do not attempt to parse the schema before the data is loaded. check-in: 4e1b005e user: dan tags: trunk
10:29
Detect zero-length free slots on btree pages and report that as corruption. check-in: c4f0568f user: drh tags: trunk
2019-03-12
09:49
Fix a crash that could occur if the RHS of an IN expression is a correlated sub-query that refers to the outer query from within a window frame definition only. check-in: 0524aaaf user: dan tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/btree.c.

  1569   1569           ** for the portion used by the new allocation. */
  1570   1570           put2byte(&aData[pc+2], x);
  1571   1571         }
  1572   1572         return &aData[pc + x];
  1573   1573       }
  1574   1574       iAddr = pc;
  1575   1575       pc = get2byte(&aData[pc]);
  1576         -    if( pc<iAddr+size ){
         1576  +    if( pc<=iAddr+size ){
  1577   1577         if( pc ){
  1578   1578           /* The next slot in the chain is not past the end of the current slot */
  1579   1579           *pRc = SQLITE_CORRUPT_PAGE(pPg);
  1580   1580         }
  1581   1581         return 0;
  1582   1582       }
  1583   1583     }