1
0
mirror of https://github.com/sqlite/sqlite.git synced 2025-08-08 14:02:16 +03:00

Fix pointer aliasing problem in the in-memory journal code.

Ref: [https://sqlite.org/forum/forumpost/d44eb2fc44|forum post d44eb2fc44]

FossilOrigin-Name: 892e9191dc8f805678a501db1993437ee99a1e1849496a0a24ceec9b84123257
This commit is contained in:
drh
2020-07-24 09:14:44 +00:00
parent 38f0ccc070
commit d9059bdb5b
3 changed files with 1813 additions and 10 deletions

View File

@@ -366,7 +366,7 @@ int sqlite3JournalOpen(
assert( MEMJOURNAL_DFLT_FILECHUNKSIZE==fileChunkSize(p->nChunkSize) );
}
p->pMethod = (const sqlite3_io_methods*)&MemJournalMethods;
pJfd->pMethods = (const sqlite3_io_methods*)&MemJournalMethods;
p->nSpill = nSpill;
p->flags = flags;
p->zJournal = zName;
@@ -392,7 +392,7 @@ void sqlite3MemJournalOpen(sqlite3_file *pJfd){
int sqlite3JournalCreate(sqlite3_file *pJfd){
int rc = SQLITE_OK;
MemJournal *p = (MemJournal*)pJfd;
if( p->pMethod==&MemJournalMethods && (
if( pJfd->pMethods==&MemJournalMethods && (
#ifdef SQLITE_ENABLE_ATOMIC_WRITE
p->nSpill>0
#else