/ Check-in [3b78ffe0]
Login
SQLite training in Houston TX on 2019-11-05 (details)
Part of the 2019 Tcl Conference

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

Overview
Comment:Fix a buffer overrun in the atomic multifile commit logic of the pager. (CVS 1556)
Downloads: Tarball | ZIP archive | SQL archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3b78ffe0b5dfa20e5c638d85ed400afda8a9f948
User & Date: drh 2004-06-10 00:51:44
Context
2004-06-10
01:08
Tests in lock.test no conform to the new locking scheme. (CVS 1557) check-in: a60afd04 user: drh tags: trunk
00:51
Fix a buffer overrun in the atomic multifile commit logic of the pager. (CVS 1556) check-in: 3b78ffe0 user: drh tags: trunk
00:29
Check for schema updates if the parser fails to find a table. More locking test updates. (CVS 1555) check-in: a2228351 user: drh tags: trunk
Changes
Hide Diffs Side-by-Side Diffs Ignore Whitespace Patch

Changes to src/pager.c.

    14     14   ** The pager is used to access a database disk file.  It implements
    15     15   ** atomic commit and rollback through the use of a journal file that
    16     16   ** is separate from the database file.  The pager also implements file
    17     17   ** locking to prevent two processes from writing the same database
    18     18   ** file simultaneously, or one process from reading the database while
    19     19   ** another is writing.
    20     20   **
    21         -** @(#) $Id: pager.c,v 1.117 2004/06/09 20:03:09 drh Exp $
           21  +** @(#) $Id: pager.c,v 1.118 2004/06/10 00:51:44 drh Exp $
    22     22   */
    23     23   #include "os.h"         /* Must be first to enable large file support */
    24     24   #include "sqliteInt.h"
    25     25   #include "pager.h"
    26     26   #include <assert.h>
    27     27   #include <string.h>
    28     28   
................................................................................
   805    805     if( rc ) goto end_playback;
   806    806     if( nMaster>0 ){
   807    807       zMaster = sqliteMalloc(nMaster);
   808    808       if( !zMaster ){
   809    809         rc = SQLITE_NOMEM;
   810    810         goto end_playback;
   811    811       }
   812         -    rc = sqlite3OsRead(&pPager->jfd, zMaster, pPager->nMaster);
          812  +    rc = sqlite3OsRead(&pPager->jfd, zMaster, nMaster);
   813    813       if( rc!=SQLITE_OK || (zMaster[0] && !sqlite3OsFileExists(zMaster)) ){
   814    814         goto end_playback;
   815    815       }
   816    816     }
   817    817   
   818    818     /* Truncate the database file back to it's original size */
   819    819     assert( pPager->origDbSize==0 || pPager->origDbSize==mxPg );