SQLite

Check-in [c4f0568fde]
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
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: c4f0568fde1d4070e7522ec36c0958be7426076002a7fa2da12a46411ab2e92d
User & Date: drh 2019-03-13 10:29:16.433
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: 4e1b005e8b user: dan tags: trunk)
10:29
Detect zero-length free slots on btree pages and report that as corruption. (check-in: c4f0568fde 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: 0524aaaf45 user: dan tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/btree.c.
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
        ** for the portion used by the new allocation. */
        put2byte(&aData[pc+2], x);
      }
      return &aData[pc + x];
    }
    iAddr = pc;
    pc = get2byte(&aData[pc]);
    if( pc<iAddr+size ){
      if( pc ){
        /* The next slot in the chain is not past the end of the current slot */
        *pRc = SQLITE_CORRUPT_PAGE(pPg);
      }
      return 0;
    }
  }







|







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