SQLite

Check-in [3b78ffe0b5]
Login

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
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA1: 3b78ffe0b5dfa20e5c638d85ed400afda8a9f948
User & Date: drh 2004-06-10 00:51:44.000
Context
2004-06-10
01:08
Tests in lock.test no conform to the new locking scheme. (CVS 1557) (check-in: a60afd04c5 user: drh tags: trunk)
00:51
Fix a buffer overrun in the atomic multifile commit logic of the pager. (CVS 1556) (check-in: 3b78ffe0b5 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: a22283512a user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/pager.c.
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
** The pager is used to access a database disk file.  It implements
** atomic commit and rollback through the use of a journal file that
** is separate from the database file.  The pager also implements file
** locking to prevent two processes from writing the same database
** file simultaneously, or one process from reading the database while
** another is writing.
**
** @(#) $Id: pager.c,v 1.117 2004/06/09 20:03:09 drh Exp $
*/
#include "os.h"         /* Must be first to enable large file support */
#include "sqliteInt.h"
#include "pager.h"
#include <assert.h>
#include <string.h>








|







14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
** The pager is used to access a database disk file.  It implements
** atomic commit and rollback through the use of a journal file that
** is separate from the database file.  The pager also implements file
** locking to prevent two processes from writing the same database
** file simultaneously, or one process from reading the database while
** another is writing.
**
** @(#) $Id: pager.c,v 1.118 2004/06/10 00:51:44 drh Exp $
*/
#include "os.h"         /* Must be first to enable large file support */
#include "sqliteInt.h"
#include "pager.h"
#include <assert.h>
#include <string.h>

805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
  if( rc ) goto end_playback;
  if( nMaster>0 ){
    zMaster = sqliteMalloc(nMaster);
    if( !zMaster ){
      rc = SQLITE_NOMEM;
      goto end_playback;
    }
    rc = sqlite3OsRead(&pPager->jfd, zMaster, pPager->nMaster);
    if( rc!=SQLITE_OK || (zMaster[0] && !sqlite3OsFileExists(zMaster)) ){
      goto end_playback;
    }
  }

  /* Truncate the database file back to it's original size */
  assert( pPager->origDbSize==0 || pPager->origDbSize==mxPg );







|







805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
  if( rc ) goto end_playback;
  if( nMaster>0 ){
    zMaster = sqliteMalloc(nMaster);
    if( !zMaster ){
      rc = SQLITE_NOMEM;
      goto end_playback;
    }
    rc = sqlite3OsRead(&pPager->jfd, zMaster, nMaster);
    if( rc!=SQLITE_OK || (zMaster[0] && !sqlite3OsFileExists(zMaster)) ){
      goto end_playback;
    }
  }

  /* Truncate the database file back to it's original size */
  assert( pPager->origDbSize==0 || pPager->origDbSize==mxPg );