Don't load pages past the end of the file
Dependencies
- [2]
ECPAFJSBadd env_borrow for Txn and MutTxn - [3]
OP6SVMODResetting history - [4]
W2MIZD5BSingle file databases + CRC for the root pages (checking the other pages makes everything very slow) - [5]
YXKP4AIWNew file locks, with multiple sets of free pages - [*]
WS4ZQM4RDebugging, tests, etc. - [*]
E4MD6T3LProofreading and commenting of this crate (massive bug fixes included)
Change contents
- edit in sanakirja/src/lib.rs at line 131
/// Corruption error#[error("Corruption error: offset {0} is past the end of the file")]Corrupt(u64), - edit in sanakirja/src/environment/muttxn.rs at line 622
if off > self.length {return Err(Error::Corrupt(off))} - edit in sanakirja/src/environment/mod.rs at line 462[8.29235][2.123]
pub(crate) size: u64, - edit in sanakirja/src/environment/mod.rs at line 496
};// Load the header from the root page of this transaction, and// get its length. This is used as a check to avoid loading a// page past the end of the file.let size = unsafe {let next_page_ptr = env_.mmaps.lock()[0].ptr.offset((root * PAGE_SIZE) as isize);let header = GlobalHeader::from_le(&*(next_page_ptr as *const GlobalHeader));header.length - edit in sanakirja/src/environment/mod.rs at line 506
- replacement in sanakirja/src/environment/mod.rs at line 508
Ok(Txn { env, root })Ok(Txn { env, root, size }) - edit in sanakirja/src/environment/mod.rs at line 567
if off > self.size {return Err(Error::Corrupt(off))}